ANDROID: sched: Disable energy-unfriendly nohz kicks
authorMorten Rasmussen <morten.rasmussen@arm.com>
Tue, 3 Feb 2015 13:54:11 +0000 (13:54 +0000)
committerChris Redpath <chris.redpath@arm.com>
Tue, 19 Dec 2017 13:25:43 +0000 (13:25 +0000)
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 <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
Change-Id: Iba347168ea34c152117d0f139e82d0d92ba2de20
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
kernel/sched/fair.c

index 3f5a9ef5892159c6bf03b27914276d57286da834..b72a1006f7195282d7ed3c0fb91a7cb3f10e2f02 100644 (file)
@@ -9403,12 +9403,13 @@ static inline bool nohz_kick_needed(struct rq *rq)
        if (time_before(now, nohz.next_balance))
                return false;
 
-       if (rq->nr_running >= 2)
+       if (rq->nr_running >= 2 &&
+           (!energy_aware() || cpu_overutilized(cpu)))
                return true;
 
        rcu_read_lock();
        sds = rcu_dereference(per_cpu(sd_llc_shared, cpu));
-       if (sds) {
+       if (sds && !energy_aware()) {
                /*
                 * XXX: write a coherent comment on why we do this.
                 * See also: http://lkml.kernel.org/r/20111202010832.602203411@sbsiddha-desk.sc.intel.com