History

sched/x86: Calculate booted cores after construction of sibling_mask

Commit 316ad248307fb ("sched/x86: Rewrite set_cpu_sibling_map()") broke the booted_cores accounting. The problem is that the booted_cores accounting needs all the sibling links set up. So restore the second loop and add a comment as to why its needed. On qemu booted with -smp sockets=1,cores=2,threads=2; Before: $ grep cores /proc/cpuinfo cpu cores : 2 cpu cores : 1 cpu cores : 4 cpu cores : 3 With the patch: $ grep cores /proc/cpuinfo cpu cores : 2 cpu cores : 2 cpu cores : 2 cpu cores : 2

Kamalesh Babulal committed 14 years ago

Commit ceb1cba1 parent eea5b551 file · +9 −0Browse files

Unified · Split

arch/x86/kernel/smpboot.c+9−0
@@ -382,6 +382,15 @@ void __cpuinit set_cpu_sibling_map(int cpu) · 381 unmodified lines
382 if ((i == cpu) || (has_mc && match_llc(c, o)))382 if ((i == cpu) || (has_mc && match_llc(c, o)))
383 link_mask(llc_shared, cpu, i);383 link_mask(llc_shared, cpu, i);
384 384
385 }
386
387 /*
388 * This needs a separate iteration over the cpus because we rely on all
389 * cpu_sibling_mask links to be set-up.
390 */
391 for_each_cpu(i, cpu_sibling_setup_mask) {
392 o = &cpu_data(i);
393
385 if ((i == cpu) || (has_mc && match_mc(c, o))) {394 if ((i == cpu) || (has_mc && match_mc(c, o))) {
386 link_mask(core, cpu, i);395 link_mask(core, cpu, i);
387 396

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t