diff options
author | Morten Rasmussen <morten.rasmussen@arm.com> | 2012-11-16 18:32:39 +0000 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2012-11-17 08:49:47 +0530 |
commit | 013e9a29eec75166e1cf07cf9e7926407a1b36f4 (patch) | |
tree | 3c0394d172c07bf3ed5ee8aab965a7b877d30b2d | |
parent | 6b154e6d26d133bb9cbfc05205fd81ba2b114d64 (diff) |
sched: SD_SHARE_POWERLINE buddy selection fix
Fixes update_packing_domain() to behave better for topologies where
SD_SHARE_POWERLINE is disabled at highest sched domain level.
Signed-of-by: Morten Rasmussen <morten.rasmussen@arm.com>
-rw-r--r-- | kernel/sched/fair.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5a93ae363d09..7d1c651ae23f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -179,7 +179,8 @@ void update_packing_domain(int cpu) if (!sd) sd = rcu_dereference_check_sched_domain(cpu_rq(cpu)->sd); else - sd = sd->parent; + if (cpumask_first(sched_domain_span(sd)) == cpu || !sd->parent) + sd = sd->parent; while (sd) { struct sched_group *sg = sd->groups; @@ -190,6 +191,18 @@ void update_packing_domain(int cpu) if (id == -1) id = cpumask_first(sched_domain_span(sd)); + /* Find sched group of candidate */ + tmp = sd->groups; + do { + if (cpumask_test_cpu(id, sched_group_cpus(tmp))) { + sg = tmp; + break; + } + } while (tmp = tmp->next, tmp != sd->groups); + + pack = sg; + tmp = sg->next; + /* loop the sched groups to find the best one */ while (tmp != sg) { if (tmp->sgp->power * sg->group_weight < |