Current code checks destination CPU is overutilized or not before kick active load balance and if the destination CPU is overutilized the function will bail out without kicking active balance.
This patch is more aggressively to kick active balance if find source CPU has single misfit task and destination CPU is in idle balance. So this can quickly migrate the misfit task to higher capacity CPU.
Signed-off-by: Leo Yan leo.yan@linaro.org --- kernel/sched/fair.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1cf0e37..d0742a7 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7859,6 +7859,11 @@ static int need_active_balance(struct lb_env *env) return 1; }
+ if ((env->idle != CPU_NOT_IDLE) && + (capacity_orig_of(env->src_cpu) < capacity_orig_of(env->dst_cpu)) && + env->src_rq->cfs.h_nr_running == 1 && env->src_rq->misfit_task) + return 1; + return unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2); }
-- 2.7.4