sched: walt: Fix max_util calculation

When calculating max_util for energy evaluations, we adjust the util on
the basis of frequency, using arch_scale_freq_capacity. However, the
return value is scaled to 1024 and not to the capacity of the CPU.

Change-Id: I214ac4b40b88105147c2e5dcc350ff1601496d4c
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Shaleen Agrawal 2021-06-16 17:53:24 -07:00 committed by Rishabh Bhatnagar
parent 8d553f6471
commit cfb4162ea3

View File

@ -516,7 +516,9 @@ static inline unsigned long walt_em_cpu_energy(struct em_perf_domain *pd,
scale_cpu = arch_scale_cpu_capacity(cpu);
max_util = max_util + (max_util >> 2); /* account for TARGET_LOAD usually 80 */
max_util = max(max_util, arch_scale_freq_capacity(cpu));
max_util = max(max_util,
(arch_scale_freq_capacity(cpu) * capacity_orig_of(cpu)) >>
SCHED_CAPACITY_SHIFT);
/*
* The capacity of a CPU in the domain at the performance state (ps)