Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212008
b: refs/heads/master
c: d4fbe4f
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Herrmann authored and H. Peter Anvin committed Oct 1, 2010
1 parent 1b08822 commit 637ab79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6057b4d331f19a3ea51aec463ea7839c128b3227
refs/heads/master: d4fbe4f03557e1fd4d9bbb3a1957aad560f39e96
28 changes: 20 additions & 8 deletions trunk/arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,19 @@ void __cpuinit smp_store_cpu_info(int id)
identify_secondary_cpu(c);
}

static void __cpuinit link_thread_siblings(int cpu1, int cpu2)
{
struct cpuinfo_x86 *c1 = &cpu_data(cpu1);
struct cpuinfo_x86 *c2 = &cpu_data(cpu2);

cpumask_set_cpu(cpu1, cpu_sibling_mask(cpu2));
cpumask_set_cpu(cpu2, cpu_sibling_mask(cpu1));
cpumask_set_cpu(cpu1, cpu_core_mask(cpu2));
cpumask_set_cpu(cpu2, cpu_core_mask(cpu1));
cpumask_set_cpu(cpu1, c2->llc_shared_map);
cpumask_set_cpu(cpu2, c1->llc_shared_map);
}


void __cpuinit set_cpu_sibling_map(int cpu)
{
Expand All @@ -409,14 +422,13 @@ void __cpuinit set_cpu_sibling_map(int cpu)
for_each_cpu(i, cpu_sibling_setup_mask) {
struct cpuinfo_x86 *o = &cpu_data(i);

if (c->phys_proc_id == o->phys_proc_id &&
c->cpu_core_id == o->cpu_core_id) {
cpumask_set_cpu(i, cpu_sibling_mask(cpu));
cpumask_set_cpu(cpu, cpu_sibling_mask(i));
cpumask_set_cpu(i, cpu_core_mask(cpu));
cpumask_set_cpu(cpu, cpu_core_mask(i));
cpumask_set_cpu(i, c->llc_shared_map);
cpumask_set_cpu(cpu, o->llc_shared_map);
if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
if (c->phys_proc_id == o->phys_proc_id &&
c->compute_unit_id == o->compute_unit_id)
link_thread_siblings(cpu, i);
} else if (c->phys_proc_id == o->phys_proc_id &&
c->cpu_core_id == o->cpu_core_id) {
link_thread_siblings(cpu, i);
}
}
} else {
Expand Down

0 comments on commit 637ab79

Please sign in to comment.