diff options
author | Rohit Gupta <rohgup@codeaurora.org> | 2013-11-21 14:51:07 -0800 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 19:58:41 -0700 |
commit | 43cc939d93415137e13e3a70c6f6076c67f29e27 (patch) | |
tree | a29869717badeb43fb7d1193d9e4cec906b965d9 /drivers/cpufreq | |
parent | 2014424f4a34de4b17ec9445775c6a85b648f081 (diff) |
cpufreq: Add a sync limit to cpu-boost
Perform frequency synchronization only when source CPU's frequency
is less than sync_threshold, else sync to the sync_threshold.
Change-Id: I544c414568d4e015b80ce5891dd215275bac95da
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpu-boost.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpu-boost.c b/drivers/cpufreq/cpu-boost.c index 91077f531b9e..d1fa3d0caff2 100644 --- a/drivers/cpufreq/cpu-boost.c +++ b/drivers/cpufreq/cpu-boost.c @@ -39,6 +39,8 @@ static struct workqueue_struct *boost_rem_wq; static unsigned int boost_ms; module_param(boost_ms, uint, 0644); +static unsigned int sync_threshold; +module_param(sync_threshold, uint, 0644); /* * The CPUFREQ_ADJUST notifier is used to override the current policy min to * make sure policy min >= boost_min. The cpufreq framework then does the job @@ -120,8 +122,15 @@ static int boost_mig_sync_thread(void *data) continue; } + if (sync_threshold && (dest_policy.cur >= sync_threshold)) + continue; + cancel_delayed_work_sync(&s->boost_rem); - s->boost_min = src_policy.cur; + if (sync_threshold) + s->boost_min = min(sync_threshold, src_policy.cur); + else + s->boost_min = src_policy.cur; + /* Force policy re-evaluation to trigger adjust notifier. */ cpufreq_update_policy(dest_cpu); queue_delayed_work_on(s->cpu, boost_rem_wq, |