sched/fair: Avoid unnecessary balancing of asymmetric capacity groups
authorMorten Rasmussen <morten.rasmussen@arm.com>
Tue, 7 Mar 2017 16:41:26 +0000 (16:41 +0000)
committerLukasz Luba <l.luba@partner.samsung.com>
Mon, 10 Sep 2018 08:20:17 +0000 (10:20 +0200)
On systems with asymmetric cpu capacities, a skewed load distribution
might yield better throughput than balancing load per group capacity.
For example, running compute intensive tasks on high capacity cpus while
leaving low capacity cpus idle. So we let load-balance back off if the
busiest group isn't really overloaded.

cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>

Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
kernel/sched/fair.c

index ccf562f70ec19686878c6b30588693c890dd30e2..be7bbc12ef07f7ade05f0aafb27f162b50bd3bb9 100644 (file)
@@ -7876,6 +7876,15 @@ static bool update_sd_pick_busiest(struct lb_env *env,
            group_smaller_cpu_capacity(sds->local, sg))
                return false;
 
+       /*
+        * Candidate sg doesn't face any severe imbalance issues so
+        * don't disturb unless the groups are of similar capacity
+        * where balancing is more harmless.
+        */
+       if (sgs->group_type == group_other &&
+               !group_similar_cpu_capacity(sds->local, sg))
+               return false;
+
 asym_packing:
        /* This is the busiest node in its class. */
        if (!(env->sd->flags & SD_ASYM_PACKING))