ANDROID: sched: Enable idle balance to pull single task towards cpu with higher capacity

We do not want to miss out on the ability to pull a single remaining
task from a potential source cpu towards an idle destination cpu. Add an
extra criteria to need_active_balance() to kick off active load balance
if the source cpu is over-utilized and has lower capacity than the
destination cpu.

Change-Id: Iea3b42b2a0f8d8a4252e42ba67cc33381a4a1075
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
(Fixed rebase conflict caused by the introduction of
voluntary_active_balance() in "46a745d90585 sched/fair: Fix unnecessary
increase of balance interval")
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
This commit is contained in:
Dietmar Eggemann 2015-01-26 19:47:28 +00:00 committed by Quentin Perret
parent 7846cccba0
commit f2fce2f48c

View File

@ -8750,6 +8750,13 @@ static int need_active_balance(struct lb_env *env)
if (voluntary_active_balance(env))
return 1;
if ((capacity_of(env->src_cpu) < capacity_of(env->dst_cpu)) &&
env->src_rq->cfs.h_nr_running == 1 &&
cpu_overutilized(env->src_cpu) &&
!cpu_overutilized(env->dst_cpu)) {
return 1;
}
return unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2);
}