From: Morten Rasmussen <morten.rasmus...@arm.com>

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.rasmus...@arm.com>
---
 kernel/sched/fair.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0ee9834..d758086 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -184,7 +184,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;
@@ -195,6 +196,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 <
-- 
1.7.9.5



_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to