From ebc28671a5a3a657c1f88fbde4be07c4ef395aef Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Mon, 27 Mar 2017 15:00:14 +0100 Subject: [PATCH] sched/fair: kick nohz idle balance for misfit task If there have misfit task on one CPU, current code does not handle this situation for nohz idle balance. As result, we can see the misfit task stays run on little core for long time. So this patch check if the CPU has misfit task or not. If has misfit task then kick nohz idle balance so finally can execute active balance. Change-Id: I117d3b7404296f8de11cb960a87a6b9a54a9f348 Signed-off-by: Leo Yan [taken from https://lists.linaro.org/pipermail/eas-dev/2016-September/000551.html] Signed-off-by: Chris Redpath Signed-off-by: Patrick Bellasi --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index dff742f276d7..90b44c6cca37 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9701,6 +9701,10 @@ static inline bool nohz_kick_needed(struct rq *rq) (!energy_aware() || cpu_overutilized(cpu))) return true; + /* Do idle load balance if there have misfit task */ + if (energy_aware() && rq->misfit_task) + return true; + rcu_read_lock(); sd = rcu_dereference(per_cpu(sd_busy, cpu)); if (sd && !energy_aware()) {