diff options
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 8b3bfc4dd708..bc2cc444844a 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -397,6 +397,19 @@ void __cpuinit smp_store_cpu_info(int id) | |||
| 397 | identify_secondary_cpu(c); | 397 | identify_secondary_cpu(c); |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | static void __cpuinit link_thread_siblings(int cpu1, int cpu2) | ||
| 401 | { | ||
| 402 | struct cpuinfo_x86 *c1 = &cpu_data(cpu1); | ||
| 403 | struct cpuinfo_x86 *c2 = &cpu_data(cpu2); | ||
| 404 | |||
| 405 | cpumask_set_cpu(cpu1, cpu_sibling_mask(cpu2)); | ||
| 406 | cpumask_set_cpu(cpu2, cpu_sibling_mask(cpu1)); | ||
| 407 | cpumask_set_cpu(cpu1, cpu_core_mask(cpu2)); | ||
| 408 | cpumask_set_cpu(cpu2, cpu_core_mask(cpu1)); | ||
| 409 | cpumask_set_cpu(cpu1, c2->llc_shared_map); | ||
| 410 | cpumask_set_cpu(cpu2, c1->llc_shared_map); | ||
| 411 | } | ||
| 412 | |||
| 400 | 413 | ||
| 401 | void __cpuinit set_cpu_sibling_map(int cpu) | 414 | void __cpuinit set_cpu_sibling_map(int cpu) |
| 402 | { | 415 | { |
| @@ -409,14 +422,13 @@ void __cpuinit set_cpu_sibling_map(int cpu) | |||
| 409 | for_each_cpu(i, cpu_sibling_setup_mask) { | 422 | for_each_cpu(i, cpu_sibling_setup_mask) { |
| 410 | struct cpuinfo_x86 *o = &cpu_data(i); | 423 | struct cpuinfo_x86 *o = &cpu_data(i); |
| 411 | 424 | ||
| 412 | if (c->phys_proc_id == o->phys_proc_id && | 425 | if (cpu_has(c, X86_FEATURE_TOPOEXT)) { |
| 413 | c->cpu_core_id == o->cpu_core_id) { | 426 | if (c->phys_proc_id == o->phys_proc_id && |
| 414 | cpumask_set_cpu(i, cpu_sibling_mask(cpu)); | 427 | c->compute_unit_id == o->compute_unit_id) |
| 415 | cpumask_set_cpu(cpu, cpu_sibling_mask(i)); | 428 | link_thread_siblings(cpu, i); |
| 416 | cpumask_set_cpu(i, cpu_core_mask(cpu)); | 429 | } else if (c->phys_proc_id == o->phys_proc_id && |
| 417 | cpumask_set_cpu(cpu, cpu_core_mask(i)); | 430 | c->cpu_core_id == o->cpu_core_id) { |
| 418 | cpumask_set_cpu(i, c->llc_shared_map); | 431 | link_thread_siblings(cpu, i); |
| 419 | cpumask_set_cpu(cpu, o->llc_shared_map); | ||
| 420 | } | 432 | } |
| 421 | } | 433 | } |
| 422 | } else { | 434 | } else { |
