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

Commit 8f8f9811 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala Committed by Gerrit - the friendly Code Review server
Browse files

cpufreq: schedutil: fix CPU util when WALT is enabled



Right now, when WALT is enabled, we always end up using utilization
from WALT which is broken as we need to consider uclamp as well.
Fix the issue by taking uclamp into account.

Change-Id: Ie1a06d270a176771fc1c9a2474a27327637fa782
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 59d3346d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -390,17 +390,17 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
{
	struct rq *rq = cpu_rq(sg_cpu->cpu);
	unsigned long max = arch_scale_cpu_capacity(sg_cpu->cpu);
#ifdef CONFIG_SCHED_WALT
	unsigned long util;

	sg_cpu->max = max;
	sg_cpu->bw_dl = cpu_bw_dl(rq);

	return cpu_util_freq(sg_cpu->cpu, &sg_cpu->walt_load);
#else
	unsigned long util = cpu_util_freq(sg_cpu->cpu, NULL) + cpu_util_rt(rq);
#ifdef CONFIG_SCHED_WALT
	util = cpu_util_freq(sg_cpu->cpu, &sg_cpu->walt_load);

	sg_cpu->max = max;
	sg_cpu->bw_dl = cpu_bw_dl(rq);
	return uclamp_util(rq, util);
#else
	util = cpu_util_freq(sg_cpu->cpu, NULL) + cpu_util_rt(rq);

	return schedutil_cpu_util(sg_cpu->cpu, util, max, FREQUENCY_UTIL, NULL);
#endif