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

Commit 44791a47 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Ionela Voinescu
Browse files

ANDROID: sched/fair: add arch scaling function for max frequency capping



To be able to scale the cpu capacity by this factor introduce a call to
the new arch scaling function arch_scale_max_freq_capacity() in
update_cpu_capacity() and provide a default implementation which returns
SCHED_CAPACITY_SCALE.

Another subsystem (e.g. cpufreq) or architectural or platform specific
code can overwrite this default implementation, exactly as for frequency
and cpu invariance. It has to be enabled by the arch by defining
arch_scale_max_freq_capacity to the actual implementation.

Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Change-Id: I770a8b1f4f7340e9e314f71c64a765bf880f4b4d
parent 40bea171
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -8841,6 +8841,9 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)

	cpu_rq(cpu)->cpu_capacity_orig = capacity;

	capacity *= arch_scale_max_freq_capacity(sd, cpu);
	capacity >>= SCHED_CAPACITY_SHIFT;

	capacity *= scale_rt_capacity(cpu);
	capacity >>= SCHED_CAPACITY_SHIFT;

+8 −0
Original line number Diff line number Diff line
@@ -1735,6 +1735,14 @@ unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu)
}
#endif

#ifndef arch_scale_max_freq_capacity
static __always_inline
unsigned long arch_scale_max_freq_capacity(struct sched_domain *sd, int cpu)
{
	return SCHED_CAPACITY_SCALE;
}
#endif

#ifndef arch_scale_cpu_capacity
static __always_inline
unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu)