mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
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 <mingo@redhat.com> cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com> Change-Id: I8b08a0fa73f357a9972324bc76cec3912fe293cf Signed-off-by: Chris Redpath <chris.redpath@arm.com> Git-commit: c42f9795e6a0c0e9d3cc6e1fe02fa60829ceb23a Git-repo: https://android.googlesource.com/kernel/common/ Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org> [clingutla@codeaurora.org: Took partial commit '5494e2edf59c2 ("ANDROID: sched: Consider misfit tasks when load-balancing")', which defined function group_similar_cpu_capacity.] Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
This commit is contained in:
parent
44d528b138
commit
b53675c0d2
1 changed files with 22 additions and 0 deletions
|
|
@ -8061,6 +8061,19 @@ group_smaller_max_cpu_capacity(struct sched_group *sg, struct sched_group *ref)
|
|||
return fits_capacity(sg->sgc->max_capacity, ref->sgc->max_capacity);
|
||||
}
|
||||
|
||||
/*
|
||||
* group_similar_cpu_capacity: Returns true if the minimum capacity of the
|
||||
* compared groups differ by less than 12.5%.
|
||||
*/
|
||||
static inline bool
|
||||
group_similar_cpu_capacity(struct sched_group *sg, struct sched_group *ref)
|
||||
{
|
||||
long diff = sg->sgc->min_capacity - ref->sgc->min_capacity;
|
||||
long max = max(sg->sgc->min_capacity, ref->sgc->min_capacity);
|
||||
|
||||
return abs(diff) < max >> 3;
|
||||
}
|
||||
|
||||
static inline enum
|
||||
group_type group_classify(struct sched_group *group,
|
||||
struct sg_lb_stats *sgs)
|
||||
|
|
@ -8215,6 +8228,15 @@ static bool update_sd_pick_busiest(struct lb_env *env,
|
|||
group_smaller_min_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;
|
||||
|
||||
/*
|
||||
* If we have more than one misfit sg go with the biggest misfit.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue