提交 bc3c4327 编写于 作者: L Li Zhong 提交者: Michael Ellerman

powerpc: Only set numa node information for present cpus at boottime

As Nish suggested, it makes more sense to init the numa node informatiion
for present cpus at boottime, which could also avoid WARN_ON(1) in
numa_setup_cpu().

With this change, we also need to change the smp_prepare_cpus() to set up
numa information only on present cpus.

For those possible, but not present cpus, their numa information
will be set up after they are started, as the original code did before commit
2fabf084.

Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
Acked-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
Tested-by: NCyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 70ad2375
...@@ -380,8 +380,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus) ...@@ -380,8 +380,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
/* /*
* numa_node_id() works after this. * numa_node_id() works after this.
*/ */
if (cpu_present(cpu)) {
set_cpu_numa_node(cpu, numa_cpu_lookup_table[cpu]); set_cpu_numa_node(cpu, numa_cpu_lookup_table[cpu]);
set_cpu_numa_mem(cpu, local_memory_node(numa_cpu_lookup_table[cpu])); set_cpu_numa_mem(cpu,
local_memory_node(numa_cpu_lookup_table[cpu]));
}
} }
cpumask_set_cpu(boot_cpuid, cpu_sibling_mask(boot_cpuid)); cpumask_set_cpu(boot_cpuid, cpu_sibling_mask(boot_cpuid));
...@@ -729,6 +732,9 @@ void start_secondary(void *unused) ...@@ -729,6 +732,9 @@ void start_secondary(void *unused)
} }
traverse_core_siblings(cpu, true); traverse_core_siblings(cpu, true);
set_numa_node(numa_cpu_lookup_table[cpu]);
set_numa_mem(local_memory_node(numa_cpu_lookup_table[cpu]));
smp_wmb(); smp_wmb();
notify_cpu_starting(cpu); notify_cpu_starting(cpu);
set_cpu_online(cpu, true); set_cpu_online(cpu, true);
......
...@@ -1127,7 +1127,7 @@ void __init do_init_bootmem(void) ...@@ -1127,7 +1127,7 @@ void __init do_init_bootmem(void)
* even before we online them, so that we can use cpu_to_{node,mem} * even before we online them, so that we can use cpu_to_{node,mem}
* early in boot, cf. smp_prepare_cpus(). * early in boot, cf. smp_prepare_cpus().
*/ */
for_each_possible_cpu(cpu) { for_each_present_cpu(cpu) {
numa_setup_cpu((unsigned long)cpu); numa_setup_cpu((unsigned long)cpu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册