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

Commit f763741d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpufreq: schedutil: Avoid WALT logic when WALT sysctl flag not set"

parents b6926a36 703e2432
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include <linux/kthread.h>
#include <linux/slab.h>
#include <trace/events/power.h>

#include <linux/sched/sysctl.h>
#include "sched.h"

#define SUGOV_KTHREAD_PRIORITY	50
@@ -216,6 +216,10 @@ static void sugov_track_cycles(struct sugov_policy *sg_policy,
				u64 upto)
{
	u64 delta_ns, cycles;

	if (unlikely(!sysctl_sched_use_walt_cpu_util))
		return;

	/* Track cycles in current window */
	delta_ns = upto - sg_policy->last_cyc_update_time;
	cycles = (prev_freq * delta_ns) / (NSEC_PER_SEC / KHZ);
@@ -229,6 +233,9 @@ static void sugov_calc_avg_cap(struct sugov_policy *sg_policy, u64 curr_ws,
	u64 last_ws = sg_policy->last_ws;
	unsigned int avg_freq;

	if (unlikely(!sysctl_sched_use_walt_cpu_util))
		return;

	WARN_ON(curr_ws < last_ws);
	if (curr_ws <= last_ws)
		return;
@@ -259,6 +266,9 @@ static void sugov_walt_adjust(struct sugov_cpu *sg_cpu, unsigned long *util,
	unsigned long cpu_util = sg_cpu->util;
	bool is_hiload;

	if (unlikely(!sysctl_sched_use_walt_cpu_util))
		return;

	is_hiload = (cpu_util >= mult_frac(sg_policy->avg_cap,
					   HISPEED_LOAD,
					   100));