[PATCH] x86: Allow percpu variables to be page-aligned
Let's allow page-alignment in general for per-cpu data (wanted by Xen, and Ingo suggested KVM as well). Because larger alignments can use more room, we increase the max per-cpu memory to 64k rather than 32k: it's getting a little tight. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
此提交包含在:
@@ -582,14 +582,14 @@ void __init setup_per_cpu_areas(void)
|
||||
char *ptr;
|
||||
|
||||
/* Copy section for each CPU (we discard the original) */
|
||||
size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
|
||||
size = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE);
|
||||
#ifdef CONFIG_MODULES
|
||||
if (size < PERCPU_ENOUGH_ROOM)
|
||||
size = PERCPU_ENOUGH_ROOM;
|
||||
#endif
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
|
||||
ptr = alloc_bootmem_pages_node(NODE_DATA(cpu_to_node(i)), size);
|
||||
if (!ptr)
|
||||
panic("Cannot allocate cpu data for CPU %d\n", i);
|
||||
|
||||
|
新增問題並參考
封鎖使用者