Commit ab2789213d224202237292d78aaa0c386c7b28b2

Authored by Peter Zijlstra
Committed by Ingo Molnar
1 parent 75fc2d3797

sched: Fix select_idle_sibling() regression in selecting an idle SMT sibling

Mike Galbraith reported that this recent commit:

   commit 4dcfe1025b513c2c1da5bf5586adb0e80148f612
   Author: Peter Zijlstra <peterz@infradead.org>
   Date:   Thu Nov 10 13:01:10 2011 +0100

       sched: Avoid SMT siblings in select_idle_sibling() if possible

stopped selecting an idle SMT sibling when there are no idle
cores in a single socket system.

Intent of the select_idle_sibling() was to fallback to an idle
SMT sibling, if it fails to identify an idle core. But this
fallback was not happening on systems where all the scheduler
domains had `SD_SHARE_PKG_RESOURCES' flag set.

Fix it. Slightly bigger patch of cleaning all these goto's etc
is queued up for the next release.

Reported-by: Mike Galbraith <efault@gmx.de>
Reported-by: Alex Shi <alex.shi@intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1323978421.1984.244.camel@sbsiddha-desk.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 8 additions and 6 deletions Side-by-side Diff

... ... @@ -2352,14 +2352,12 @@
2352 2352 if (!smt && (sd->flags & SD_SHARE_CPUPOWER))
2353 2353 continue;
2354 2354  
2355   - if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) {
2356   - if (!smt) {
2357   - smt = 1;
2358   - goto again;
2359   - }
  2355 + if (smt && !(sd->flags & SD_SHARE_CPUPOWER))
2360 2356 break;
2361   - }
2362 2357  
  2358 + if (!(sd->flags & SD_SHARE_PKG_RESOURCES))
  2359 + break;
  2360 +
2363 2361 sg = sd->groups;
2364 2362 do {
2365 2363 if (!cpumask_intersects(sched_group_cpus(sg),
... ... @@ -2377,6 +2375,10 @@
2377 2375 next:
2378 2376 sg = sg->next;
2379 2377 } while (sg != sd->groups);
  2378 + }
  2379 + if (!smt) {
  2380 + smt = 1;
  2381 + goto again;
2380 2382 }
2381 2383 done:
2382 2384 rcu_read_unlock();