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

Commit 958428f0 authored by Saravana Kannan's avatar Saravana Kannan Committed by Rohit Gupta
Browse files

cpufreq: schedutil: Update hispeed load condition



Checking the utilization against current capacity can cause the hispeed
load condition to be unreliable. This can happen if the hispeed condition
is reevaluated after some other event (say, migration) causes the current
frequency (and thereby current capacity) to change.

So, instead of checking against current capacity, check against the average
capacity that is less temperamental.

Change-Id: Ic1277908f7d42848ded5dd450146d1d04572eaab
Signed-off-by: default avatarSaravana Kannan <skannan@codeaurora.org>
Signed-off-by: default avatarRohit Gupta <rohgup@codeaurora.org>
parent fd330e9e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -319,13 +319,12 @@ static void sugov_walt_adjust(struct sugov_cpu *sg_cpu, unsigned long *util,
			      unsigned long *max)
{
	struct sugov_policy *sg_policy = sg_cpu->sg_policy;
	unsigned long cap_cur = capacity_curr_of(sg_cpu->cpu);
	bool is_migration = sg_cpu->flags & SCHED_CPUFREQ_INTERCLUSTER_MIG;
	unsigned long nl = sg_cpu->walt_load.nl;
	unsigned long cpu_util = sg_cpu->util;
	bool is_hiload;

	is_hiload = (cpu_util >= mult_frac(cap_cur,
	is_hiload = (cpu_util >= mult_frac(sg_policy->avg_cap,
					   sg_policy->tunables->hispeed_load,
					   100));