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

Commit 57e29051 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

sched: Skip resetting HMP stats when max frequencies remain unchanged



A change in cpufreq policy parameters currently trigger a partial reset
of HMP stats. This is necessary when there are changes in the max
frequency of any cluster since updated load scaling factors necessitate
updating the number of big and small tasks on every CPU. However, this
computation is redundant when parameters other than the max freq change.
Optimize code by avoiding the redundant calculations.

Change-Id: Ib572f5dfdc4ada378e695f328ff81e2ce31132ba
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent 0dc787c3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2710,6 +2710,10 @@ static int cpufreq_notifier_policy(struct notifier_block *nb,
	BUG_ON(!min_max_freq);
	BUG_ON(!policy->max);

	/* Changes to policy other than max_freq don't require any updates */
	if (orig_max_freq == policy->max)
		return 0;

	/*
	 * A changed min_max_freq or max_possible_freq (possible during bootup)
	 * needs to trigger re-computation of load_scale_factor and capacity for