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

Commit 58b761f4 authored by Ionela Voinescu's avatar Ionela Voinescu Committed by Quentin Perret
Browse files

sched/fair: introduce minimum capacity capping sched feature



We have the ability to track minimum capacity forced onto a CPU by
userspace or external actors. This is provided though a minimum
frequency scale factor exposed by arch_scale_min_freq_capacity.

The use of this information is enabled through the MIN_CAPACITY_CAPPING
feature. If not enabled, the minimum frequency scale factor will
remain 0 and it will not impact energy estimation or scheduling
decisions.

Change-Id: Ibc61f2bf4fddf186695b72b262e602a6e8bfde37
Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
parent 4f7837d7
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5424,6 +5424,20 @@ unsigned long capacity_curr_of(int cpu)
	       >> SCHED_CAPACITY_SHIFT;
}

/*
 * Returns the current capacity of cpu after applying both
 * cpu and min freq scaling.
 */
unsigned long capacity_min_of(int cpu)
{
	if (!sched_feat(MIN_CAPACITY_CAPPING))
		return 0;
	return arch_scale_cpu_capacity(NULL, cpu) *
	       arch_scale_min_freq_capacity(NULL, cpu)
	       >> SCHED_CAPACITY_SHIFT;
}


static inline bool energy_aware(void)
{
	return sched_feat(ENERGY_AWARE);
+8 −0
Original line number Diff line number Diff line
@@ -78,3 +78,11 @@ SCHED_FEAT(ENERGY_AWARE, true)
#else
SCHED_FEAT(ENERGY_AWARE, false)
#endif

/*
 * Minimum capacity capping. Keep track of minimum capacity factor when
 * minimum frequency available to a policy is modified.
 * If enabled, this can be used to inform the scheduler about capacity
 * restrictions.
 */
SCHED_FEAT(MIN_CAPACITY_CAPPING, false)