Skip to content

Commit

Permalink
sched: Fix select_idle_sibling() regression in selecting an idle SMT …
Browse files Browse the repository at this point in the history
…sibling

Mike Galbraith reported that this recent commit:

   commit 4dcfe10
   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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 16, 2011
1 parent 75fc2d3 commit ab27892
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -2352,13 +2352,11 @@ static int select_idle_sibling(struct task_struct *p, int target)
if (!smt && (sd->flags & SD_SHARE_CPUPOWER))
continue;

if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) {
if (!smt) {
smt = 1;
goto again;
}
if (smt && !(sd->flags & SD_SHARE_CPUPOWER))
break;

if (!(sd->flags & SD_SHARE_PKG_RESOURCES))
break;
}

sg = sd->groups;
do {
Expand All @@ -2378,6 +2376,10 @@ static int select_idle_sibling(struct task_struct *p, int target)
sg = sg->next;
} while (sg != sd->groups);
}
if (!smt) {
smt = 1;
goto again;
}
done:
rcu_read_unlock();

Expand Down

0 comments on commit ab27892

Please sign in to comment.