From c42f9795e6a0c0e9d3cc6e1fe02fa60829ceb23a Mon Sep 17 00:00:00 2001 From: Morten Rasmussen Date: Tue, 7 Mar 2017 16:41:26 +0000 Subject: [PATCH] ANDROID: sched/fair: Avoid unnecessary balancing of asymmetric capacity groups 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 cc: Peter Zijlstra Signed-off-by: Morten Rasmussen Change-Id: I8b08a0fa73f357a9972324bc76cec3912fe293cf Signed-off-by: Chris Redpath --- kernel/sched/fair.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9cf5d479cbbd..509cd715ab81 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7569,6 +7569,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)) -- 2.20.1