aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_percpu.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-01-26 22:56:47 -0500
committerTejun Heo <tj@kernel.org>2009-01-26 22:56:47 -0500
commit74631a248dc2c2129a96f6b8b706ed54bb5c3d3c (patch)
tree53e1fa4c8a6605c11fea863542c6b4e26dd6c385 /arch/x86/kernel/setup_percpu.c
parent2f2f52bad72f5e1ca5d1b9ad00a7b57a8cbd9159 (diff)
x86: always page-align per-cpu area start and size
Impact: cleanup The way the code is written, align is always PAGE_SIZE. Simplify the code by removing the align variable. Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r--arch/x86/kernel/setup_percpu.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 7bebdba8eb89..5d4a4964a8b3 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -69,15 +69,12 @@ EXPORT_SYMBOL(__per_cpu_offset);
69 */ 69 */
70void __init setup_per_cpu_areas(void) 70void __init setup_per_cpu_areas(void)
71{ 71{
72 ssize_t size, old_size; 72 ssize_t size;
73 char *ptr; 73 char *ptr;
74 int cpu; 74 int cpu;
75 unsigned long align = 1;
76 75
77 /* Copy section for each CPU (we discard the original) */ 76 /* Copy section for each CPU (we discard the original) */
78 old_size = PERCPU_ENOUGH_ROOM; 77 size = roundup(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
79 align = max_t(unsigned long, PAGE_SIZE, align);
80 size = roundup(old_size, align);
81 78
82 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n", 79 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
83 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids); 80 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
@@ -86,20 +83,17 @@ void __init setup_per_cpu_areas(void)
86 83
87 for_each_possible_cpu(cpu) { 84 for_each_possible_cpu(cpu) {
88#ifndef CONFIG_NEED_MULTIPLE_NODES 85#ifndef CONFIG_NEED_MULTIPLE_NODES
89 ptr = __alloc_bootmem(size, align, 86 ptr = alloc_bootmem_pages(size);
90 __pa(MAX_DMA_ADDRESS));
91#else 87#else
92 int node = early_cpu_to_node(cpu); 88 int node = early_cpu_to_node(cpu);
93 if (!node_online(node) || !NODE_DATA(node)) { 89 if (!node_online(node) || !NODE_DATA(node)) {
94 ptr = __alloc_bootmem(size, align, 90 ptr = alloc_bootmem_pages(size);
95 __pa(MAX_DMA_ADDRESS));
96 pr_info("cpu %d has no node %d or node-local memory\n", 91 pr_info("cpu %d has no node %d or node-local memory\n",
97 cpu, node); 92 cpu, node);
98 pr_debug("per cpu data for cpu%d at %016lx\n", 93 pr_debug("per cpu data for cpu%d at %016lx\n",
99 cpu, __pa(ptr)); 94 cpu, __pa(ptr));
100 } else { 95 } else {
101 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align, 96 ptr = alloc_bootmem_pages_node(NODE_DATA(node), size);
102 __pa(MAX_DMA_ADDRESS));
103 pr_debug("per cpu data for cpu%d on node%d at %016lx\n", 97 pr_debug("per cpu data for cpu%d on node%d at %016lx\n",
104 cpu, node, __pa(ptr)); 98 cpu, node, __pa(ptr));
105 } 99 }