Commit f05d25b9 authored by Morten Rasmussen's avatar Morten Rasmussen
Browse files

sched: Disable energy-unfriendly nohz kicks

With energy-aware scheduling enabled nohz_kick_needed() generates many
nohz idle-balance kicks which lead to nothing when multiple tasks get
packed on a single cpu to save energy. This causes unnecessary wake-ups
and hence wastes energy. Make these conditions depend on !energy_aware()
for now until the energy-aware nohz story gets sorted out.

cc: Ingo Molnar <>
cc: Peter Zijlstra <>

Signed-off-by: Morten Rasmussen's avatarMorten Rasmussen <>
parent c13fa615
......@@ -8195,6 +8195,8 @@ end:
clear_bit(NOHZ_BALANCE_KICK, nohz_flags(this_cpu));
static int cpu_overutilized(int cpu, struct sched_domain *sd);
* Current heuristic for kicking the idle load balancer in the presence
* of an idle cpu in the system.
......@@ -8234,12 +8236,13 @@ static inline bool nohz_kick_needed(struct rq *rq)
if (time_before(now, nohz.next_balance))
return false;
if (rq->nr_running >= 2)
sd = rcu_dereference(rq->sd);
if (rq->nr_running >= 2 && (!energy_aware() || cpu_overutilized(cpu, sd)))
return true;
sd = rcu_dereference(per_cpu(sd_busy, cpu));
if (sd) {
if (sd && !energy_aware()) {
sgc = sd->groups->sgc;
nr_busy = atomic_read(&sgc->nr_busy_cpus);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment