aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2012-04-18 13:04:09 -0400
committerIngo Molnar <mingo@kernel.org>2012-05-09 07:28:59 -0400
commit0acbb440f06302058e1515861dd534594521e892 (patch)
tree253d5cd412bc8b07ea9c83052ac3b7ece8b944f6 /arch
parent94c0dd3278dd3eae52eabf0fb77d472d0dd3e373 (diff)
x86/numa: Hard partition cpu topology masks on node boundaries
When using numa=fake= you can get weird topologies where LLCs can span nodes and other such nonsense. Cure this by hard partitioning these masks on node boundaries. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: x86@kernel.org Link: http://lkml.kernel.org/n/tip-di5vwjm96q5vrb76opwuflwx@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/smpboot.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6e1e406038c2..edfd03a9e390 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -337,6 +337,11 @@ void __cpuinit set_cpu_sibling_map(int cpu)
337 for_each_cpu(i, cpu_sibling_setup_mask) { 337 for_each_cpu(i, cpu_sibling_setup_mask) {
338 struct cpuinfo_x86 *o = &cpu_data(i); 338 struct cpuinfo_x86 *o = &cpu_data(i);
339 339
340#ifdef CONFIG_NUMA_EMU
341 if (cpu_to_node(cpu) != cpu_to_node(i))
342 continue;
343#endif
344
340 if (cpu_has(c, X86_FEATURE_TOPOEXT)) { 345 if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
341 if (c->phys_proc_id == o->phys_proc_id && 346 if (c->phys_proc_id == o->phys_proc_id &&
342 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i) && 347 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i) &&
@@ -360,11 +365,17 @@ void __cpuinit set_cpu_sibling_map(int cpu)
360 } 365 }
361 366
362 for_each_cpu(i, cpu_sibling_setup_mask) { 367 for_each_cpu(i, cpu_sibling_setup_mask) {
368#ifdef CONFIG_NUMA_EMU
369 if (cpu_to_node(cpu) != cpu_to_node(i))
370 continue;
371#endif
372
363 if (per_cpu(cpu_llc_id, cpu) != BAD_APICID && 373 if (per_cpu(cpu_llc_id, cpu) != BAD_APICID &&
364 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { 374 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
365 cpumask_set_cpu(i, cpu_llc_shared_mask(cpu)); 375 cpumask_set_cpu(i, cpu_llc_shared_mask(cpu));
366 cpumask_set_cpu(cpu, cpu_llc_shared_mask(i)); 376 cpumask_set_cpu(cpu, cpu_llc_shared_mask(i));
367 } 377 }
378
368 if (c->phys_proc_id == cpu_data(i).phys_proc_id) { 379 if (c->phys_proc_id == cpu_data(i).phys_proc_id) {
369 cpumask_set_cpu(i, cpu_core_mask(cpu)); 380 cpumask_set_cpu(i, cpu_core_mask(cpu));
370 cpumask_set_cpu(cpu, cpu_core_mask(i)); 381 cpumask_set_cpu(cpu, cpu_core_mask(i));