summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2013-06-05 19:01:25 +0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:02 +0900
commit81c989c8cbd64d4393199f9a75c8696d3438e06c (patch)
treef9fb29e1d91fdb86dee2ba14df4ca6d17e4a869c
parent1e24e5b6584b76198b52a9505758f4354c2f1805 (diff)
downloadlinux-3.10-81c989c8cbd64d4393199f9a75c8696d3438e06c.tar.gz
linux-3.10-81c989c8cbd64d4393199f9a75c8696d3438e06c.tar.bz2
linux-3.10-81c989c8cbd64d4393199f9a75c8696d3438e06c.zip
cpufreq: ondemand: Change the calculation of target frequency
The ondemand governor calculates load in terms of frequency and increases it only if load_freq is greater than up_threshold multiplied by the current or average frequency. This appears to produce oscillations of frequency between min and max because, for example, a relatively small load can easily saturate minimum frequency and lead the CPU to the max. Then, it will decrease back to the min due to small load_freq. Change the calculation method of load and target frequency on the basis of the following two observations: - Load computation should not depend on the current or average measured frequency. For example, absolute load of 80% at 100MHz is not necessarily equivalent to 8% at 1000MHz in the next sampling interval. - It should be possible to increase the target frequency to any value present in the frequency table proportional to the absolute load, rather than to the max only, so that: Target frequency = C * load where we take C = policy->cpuinfo.max_freq / 100. Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait. Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an increase ~1.5% in performance. cpufreq_stats (time_in_state) shows that middle frequencies are used more, with this patch. Highest and lowest frequencies were used less by ~9%. [rjw: We have run multiple other tests on kernels with this change applied and in the vast majority of cases it turns out that the resulting performance improvement also leads to reduced consumption of energy. The change is additionally justified by the overall simplification of the code in question.] Change-Id: I26399d5d61616ee9157baa7eb8b337bacab5b892 Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq_governor.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index e8035fee1ab..7eeb47fa187 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -161,14 +161,6 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
lb_dbs_info->idle_time = (100 * idle_time) / wall_time;
}
- if (dbs_data->cdata->governor == GOV_ONDEMAND) {
- int freq_avg = __cpufreq_driver_getavg(policy, j);
- if (freq_avg <= 0)
- freq_avg = policy->cur;
-
- load *= freq_avg;
- }
-
if (load > max_load)
max_load = load;
}