summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2015-08-25 14:21:38 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2015-08-25 14:21:38 +1000
commit8d278d85e0974270564118a03011ee98d2b1eebb (patch)
treece8c0bc6d839888524aeffa6feb0d149a55793c0
parent907893101216d6b15a9c2d40dd9fcf349f3d1c73 (diff)
downloadlinux-8d278d85e0974270564118a03011ee98d2b1eebb.tar.gz
linux-8d278d85e0974270564118a03011ee98d2b1eebb.tar.xz
align-crash_notes-allocation-to-make-it-be-inside-one-physical-page-fix
use correct comment layout Cc: Baoquan He <bhe@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--kernel/kexec_core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 6788ed3cf12e..322dd5579f59 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1006,19 +1006,23 @@ static int __init crash_notes_memory_init(void)
/* Allocate memory for saving cpu registers. */
size_t size, align;
- /* crash_notes could be allocated across 2 vmalloc pages when percpu
+ /*
+ * crash_notes could be allocated across 2 vmalloc pages when percpu
* is vmalloc based . vmalloc doesn't guarantee 2 continuous vmalloc
* pages are also on 2 continuous physical pages. In this case the
* 2nd part of crash_notes in 2nd page could be lost since only the
* starting address and size of crash_notes are exported through sysfs.
* Here round up the size of crash_notes to the nearest power of two
* and pass it to __alloc_percpu as align value. This can make sure
- * crash_notes is allocated inside one physical page. */
+ * crash_notes is allocated inside one physical page.
+ */
size = sizeof(note_buf_t);
align = min(roundup_pow_of_two(sizeof(note_buf_t)), PAGE_SIZE);
- /* Break compile if size is bigger than PAGE_SIZE since crash_notes
- * definitely will be in 2 pages with that. */
+ /*
+ * Break compile if size is bigger than PAGE_SIZE since crash_notes
+ * definitely will be in 2 pages with that.
+ */
BUILD_BUG_ON(size > PAGE_SIZE);
crash_notes = __alloc_percpu(size, align);