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

Commit 0a470d36 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

cpufreq: sched: WALT: don't apply capacity margin twice



With WALT all the scheduler classes' load are accounted in scr->cfs and
schedfreq adds capacity margin.  At present, at tick path, scheduler
adds capacity margin which as well.  Therefore the margin applied
twice.

Fix such error by removing applying of capacity margin at tick path.

Change-Id: Id7d8cc73b2e4eec70b274ca66e09bb0b16bf6f09
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 01388ef4
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -3296,21 +3296,10 @@ static void sched_freq_tick_pelt(int cpu)
static void sched_freq_tick_walt(int cpu)
{
	unsigned long cpu_utilization = cpu_util_freq(cpu, NULL);
	unsigned long capacity_curr = capacity_curr_of(cpu);

	if (walt_disabled || !sysctl_sched_use_walt_cpu_util)
		return sched_freq_tick_pelt(cpu);

	/*
	 * Add a margin to the WALT utilization.
	 * NOTE: WALT tracks a single CPU signal for all the scheduling
	 * classes, thus this margin is going to be added to the DL class as
	 * well, which is something we do not do in sched_freq_tick_pelt case.
	 */
	cpu_utilization = add_capacity_margin(cpu_utilization);
	if (cpu_utilization <= capacity_curr)
		return;

	cpu_utilization = cpu_utilization * SCHED_CAPACITY_SCALE /
			  capacity_orig_of(cpu);
	/*