aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2011-11-17 11:08:23 -0800
committerIngo Molnar <mingo@elte.hu>2011-12-06 08:51:25 +0100
commit77e81365e0b7d7479fc444a21cea0cd4def70b45 (patch)
treeedb0aa41e7ca436f3e1097ea5ea9da6ebee4ec81 /kernel/sched/sched.h
parentb781a602ac745ee3d5d745276f1e1905a2c101f9 (diff)
sched: Clean up domain traversal in select_idle_sibling()
Instead of going through the scheduler domain hierarchy multiple times (for giving priority to an idle core over an idle SMT sibling in a busy core), start with the highest scheduler domain with the SD_SHARE_PKG_RESOURCES flag and traverse the domain hierarchy down till we find an idle group. This cleanup also addresses an issue reported by Mike where the recent changes returned the busy thread even in the presence of an idle SMT sibling in single socket platforms. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Tested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1321556904.15339.25.camel@sbsiddha-desk.sc.intel.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index c2e780234c31..8715055979d1 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -501,6 +501,8 @@ DECLARE_PER_CPU(struct rq, runqueues);
#define for_each_domain(cpu, __sd) \
for (__sd = rcu_dereference_check_sched_domain(cpu_rq(cpu)->sd); __sd; __sd = __sd->parent)
+#define for_each_lower_domain(sd) for (; sd; sd = sd->child)
+
#define cpu_rq(cpu) (&per_cpu(runqueues, (cpu)))
#define this_rq() (&__get_cpu_var(runqueues))
#define task_rq(p) cpu_rq(task_cpu(p))