Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6879df0 authored by Morten Rasmussen's avatar Morten Rasmussen Committed by Chris Redpath
Browse files

ANDROID: sched: Make energy awareness a sched feature



This patch introduces the ENERGY_AWARE sched feature, which is
implemented using jump labels when SCHED_DEBUG is defined. It is
statically set false when SCHED_DEBUG is not defined. Hence this doesn't
allow energy awareness to be enabled without SCHED_DEBUG. This
sched_feature knob will be replaced later with a more appropriate
control knob when things have matured a bit.

ENERGY_AWARE is based on per-entity load-tracking hence FAIR_GROUP_SCHED
must be enable. This dependency isn't checked at compile time yet.

cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
Change-Id: Ib94ec79f7f5820dfaed515ede548afe2936c15c6
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
parent 8e793716
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5327,6 +5327,11 @@ static void record_wakee(struct task_struct *p)
	}
}

static inline bool energy_aware(void)
{
	return sched_feat(ENERGY_AWARE);
}

/*
 * Detect M:N waker/wakee relationships via a switching-frequency heuristic.
 *
+6 −0
Original line number Diff line number Diff line
@@ -85,3 +85,9 @@ SCHED_FEAT(ATTACH_AGE_LOAD, true)
SCHED_FEAT(WA_IDLE, true)
SCHED_FEAT(WA_WEIGHT, true)
SCHED_FEAT(WA_BIAS, true)

/*
 * Energy aware scheduling. Use platform energy model to guide scheduling
 * decisions optimizing for energy efficiency.
 */
SCHED_FEAT(ENERGY_AWARE, false)