summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2015-10-01 15:54:26 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:02:33 -0700
commita805e4b2203d601f0ff64e5eed70a4ce202e824e (patch)
tree8da1a18e39739af8f9fb0752dac30fed99e7eee5 /kernel/sched
parentcee02f81686a7295bc93252ca572456017bc641a (diff)
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: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3647ca390840..ae6e90e167b2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2707,6 +2707,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