ANDROID: sched/fair: Have sync honor fits_capacity

Some tasks, such as those related to audio, can be placed onto cores
which are too small to support them, leading to performance hits. Fix
this by having the sync wakeup path honor capacity.

Bug: 166278821
Signed-off-by: J. Avila <elavila@google.com>
Change-Id: I5f7ef330f952c95f9391eb733ad241345477c943
This commit is contained in:
J. Avila 2020-11-20 04:25:12 +00:00 committed by Todd Kjos
parent 859b5a7b1f
commit a9c5fcfe9c

View File

@ -6600,7 +6600,8 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
cpu = smp_processor_id();
if (sync && cpu_rq(cpu)->nr_running == 1 &&
cpumask_test_cpu(cpu, p->cpus_ptr)) {
cpumask_test_cpu(cpu, p->cpus_ptr) &&
task_fits_capacity(p, capacity_of(cpu))) {
rcu_read_unlock();
return cpu;
}