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

Commit 9e1c648c authored by Ionela Voinescu's avatar Ionela Voinescu Committed by Quentin Perret
Browse files

sched/fair: use min capacity when evaluating placement energy costs



Add the ability to track minimim capacity forced onto a sched_group
by some external actor.

group_max_util returns the highest utilisation inside a sched_group
and is used when we are trying to calculate an energy cost estimate
for a specific scheduling scenario. Minimum capacities imposed from
elsewhere will influence this energy cost so we should reflect it
here.

Change-Id: Ibd537a6dbe6d67b11cc9e9be18f40fcb2c0f13de
Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
parent 58b761f4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5548,6 +5548,15 @@ static unsigned long group_max_util(struct energy_env *eenv, int cpu_idx)
			util += eenv->util_delta;

		max_util = max(max_util, util);

		/*
		 * Take into account any minimum frequency imposed
		 * elsewhere which limits the energy states available
		 * If the MIN_CAPACITY_CAPPING feature is not enabled
		 * capacity_min_of will return 0 (not capped).
		 */
		max_util = max(max_util, capacity_min_of(cpu));

	}

	return max_util;