From 20017f33839a2e8e52980ba07fd14f63f2193250 Mon Sep 17 00:00:00 2001 From: Runmin Wang Date: Thu, 19 Apr 2018 18:04:32 -0700 Subject: [PATCH] sched/fair: Only kick nohz balance when runqueue has more than 1 task Misfit task will go through active migration path so there is no need to check in the nohz balance case. Change-Id: Ic05035d8c745797c4a5cbe52b7cdbd98edb352f3 Signed-off-by: Runmin Wang --- kernel/sched/fair.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e6c6729c7da1..23c9e8be90f1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11209,13 +11209,16 @@ static inline bool nohz_kick_needed(struct rq *rq, bool only_update) if (time_before(now, nohz.next_balance)) return false; + /* + * If energy aware is enabled, do idle load balance if runqueue has + * at least 2 tasks and cpu is overutilized + */ if (rq->nr_running >= 2 && (!energy_aware() || cpu_overutilized(cpu))) return true; - /* Do idle load balance if there have misfit task */ if (energy_aware()) - return rq_has_misfit(rq); + return false; rcu_read_lock(); sds = rcu_dereference(per_cpu(sd_llc_shared, cpu));