Commit ab14398a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Ingo Molnar

x86: setup_per_cpu_areas() cleanup

Impact: cleanup

__alloc_bootmem and __alloc_bootmem_node do panic
for us in case of fail so no need for additional
checks here.

Also lets use pr_*() macros for printing.
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8fd2d2d5
...@@ -153,12 +153,10 @@ void __init setup_per_cpu_areas(void) ...@@ -153,12 +153,10 @@ void __init setup_per_cpu_areas(void)
align = max_t(unsigned long, PAGE_SIZE, align); align = max_t(unsigned long, PAGE_SIZE, align);
size = roundup(old_size, align); size = roundup(old_size, align);
printk(KERN_INFO pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
"NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids); NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n", pr_info("PERCPU: Allocating %zd bytes of per cpu data\n", size);
size);
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
#ifndef CONFIG_NEED_MULTIPLE_NODES #ifndef CONFIG_NEED_MULTIPLE_NODES
...@@ -169,21 +167,14 @@ void __init setup_per_cpu_areas(void) ...@@ -169,21 +167,14 @@ void __init setup_per_cpu_areas(void)
if (!node_online(node) || !NODE_DATA(node)) { if (!node_online(node) || !NODE_DATA(node)) {
ptr = __alloc_bootmem(size, align, ptr = __alloc_bootmem(size, align,
__pa(MAX_DMA_ADDRESS)); __pa(MAX_DMA_ADDRESS));
printk(KERN_INFO pr_info("cpu %d has no node %d or node-local memory\n",
"cpu %d has no node %d or node-local memory\n",
cpu, node); cpu, node);
if (ptr) pr_debug("per cpu data for cpu%d at %016lx\n",
printk(KERN_DEBUG
"per cpu data for cpu%d at %016lx\n",
cpu, __pa(ptr)); cpu, __pa(ptr));
} } else {
else {
ptr = __alloc_bootmem_node(NODE_DATA(node), size, align, ptr = __alloc_bootmem_node(NODE_DATA(node), size, align,
__pa(MAX_DMA_ADDRESS)); __pa(MAX_DMA_ADDRESS));
if (ptr) pr_debug("per cpu data for cpu%d on node%d at %016lx\n",
printk(KERN_DEBUG
"per cpu data for cpu%d on node%d "
"at %016lx\n",
cpu, node, __pa(ptr)); cpu, node, __pa(ptr));
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment