aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2013-03-05 17:06:29 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-31 19:11:35 -0400
commit7af1c0568d33339318c6710381921a3a3d40eebb (patch)
tree4ae1c0bf763b140695e8efa0174e8453f9986ca7
parent9366d84052e7c5b2eca804c08cfcd00b490f4de2 (diff)
cpufreq: conservative: Fix sampling_down_factor functionality
sampling_down_factor tunable is unused since commit 8e677ce83bf41ba9c74e5b6d9ee60b07d4e5ed93 (4 years ago). This patch restores the original functionality and documents the tunable. 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--Documentation/cpu-freq/governors.txt6
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index c7a2eb8450c2..4dfed30b7fda 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -191,6 +191,12 @@ governor but for the opposite direction. For example when set to its
191default value of '20' it means that if the CPU usage needs to be below 191default value of '20' it means that if the CPU usage needs to be below
19220% between samples to have the frequency decreased. 19220% between samples to have the frequency decreased.
193 193
194sampling_down_factor: similar functionality as in "ondemand" governor.
195But in "conservative", it controls the rate at which the kernel makes
196a decision on when to decrease the frequency while running in any
197speed. Load for frequency increase is still evaluated every
198sampling rate.
199
1943. The Governor Interface in the CPUfreq Core 2003. The Governor Interface in the CPUfreq Core
195============================================= 201=============================================
196 202
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 52f76b19a883..d746d6abbca8 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -36,9 +36,9 @@ static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info);
36 36
37/* 37/*
38 * Every sampling_rate, we check, if current idle time is less than 20% 38 * Every sampling_rate, we check, if current idle time is less than 20%
39 * (default), then we try to increase frequency Every sampling_rate * 39 * (default), then we try to increase frequency. Every sampling_rate *
40 * sampling_down_factor, we check, if current idle time is more than 80%, then 40 * sampling_down_factor, we check, if current idle time is more than 80%
41 * we try to decrease frequency 41 * (default), then we try to decrease frequency
42 * 42 *
43 * Any frequency increase takes it to the maximum frequency. Frequency reduction 43 * Any frequency increase takes it to the maximum frequency. Frequency reduction
44 * happens at minimum steps of 5% (default) of maximum frequency 44 * happens at minimum steps of 5% (default) of maximum frequency
@@ -81,6 +81,11 @@ static void cs_check_cpu(int cpu, unsigned int load)
81 return; 81 return;
82 } 82 }
83 83
84 /* if sampling_down_factor is active break out early */
85 if (++dbs_info->down_skip < cs_tuners->sampling_down_factor)
86 return;
87 dbs_info->down_skip = 0;
88
84 /* 89 /*
85 * The optimal frequency is the frequency that is the lowest that can 90 * The optimal frequency is the frequency that is the lowest that can
86 * support the current CPU usage without triggering the up policy. To be 91 * support the current CPU usage without triggering the up policy. To be