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 <runminw@codeaurora.org>
tirimbino
Runmin Wang 7 years ago
parent f95967f731
commit 20017f3383
  1. 7
      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)) if (time_before(now, nohz.next_balance))
return false; 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 && if (rq->nr_running >= 2 &&
(!energy_aware() || cpu_overutilized(cpu))) (!energy_aware() || cpu_overutilized(cpu)))
return true; return true;
/* Do idle load balance if there have misfit task */
if (energy_aware()) if (energy_aware())
return rq_has_misfit(rq); return false;
rcu_read_lock(); rcu_read_lock();
sds = rcu_dereference(per_cpu(sd_llc_shared, cpu)); sds = rcu_dereference(per_cpu(sd_llc_shared, cpu));

Loading…
Cancel
Save