Commit 0acbb440 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter 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.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 94c0dd32
...@@ -337,6 +337,11 @@ void __cpuinit set_cpu_sibling_map(int cpu) ...@@ -337,6 +337,11 @@ void __cpuinit set_cpu_sibling_map(int cpu)
for_each_cpu(i, cpu_sibling_setup_mask) { for_each_cpu(i, cpu_sibling_setup_mask) {
struct cpuinfo_x86 *o = &cpu_data(i); struct cpuinfo_x86 *o = &cpu_data(i);
#ifdef CONFIG_NUMA_EMU
if (cpu_to_node(cpu) != cpu_to_node(i))
continue;
#endif
if (cpu_has(c, X86_FEATURE_TOPOEXT)) { if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
if (c->phys_proc_id == o->phys_proc_id && if (c->phys_proc_id == o->phys_proc_id &&
per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i) && 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,11 +365,17 @@ void __cpuinit set_cpu_sibling_map(int cpu)
} }
for_each_cpu(i, cpu_sibling_setup_mask) { for_each_cpu(i, cpu_sibling_setup_mask) {
#ifdef CONFIG_NUMA_EMU
if (cpu_to_node(cpu) != cpu_to_node(i))
continue;
#endif
if (per_cpu(cpu_llc_id, cpu) != BAD_APICID && if (per_cpu(cpu_llc_id, cpu) != BAD_APICID &&
per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
cpumask_set_cpu(i, cpu_llc_shared_mask(cpu)); cpumask_set_cpu(i, cpu_llc_shared_mask(cpu));
cpumask_set_cpu(cpu, cpu_llc_shared_mask(i)); cpumask_set_cpu(cpu, cpu_llc_shared_mask(i));
} }
if (c->phys_proc_id == cpu_data(i).phys_proc_id) { if (c->phys_proc_id == cpu_data(i).phys_proc_id) {
cpumask_set_cpu(i, cpu_core_mask(cpu)); cpumask_set_cpu(i, cpu_core_mask(cpu));
cpumask_set_cpu(cpu, cpu_core_mask(i)); cpumask_set_cpu(cpu, cpu_core_mask(i));
......
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