aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index b935092aab21..3f898606e68c 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -24,6 +24,7 @@
24 * It helps to keep variable names smaller, simpler 24 * It helps to keep variable names smaller, simpler
25 */ 25 */
26 26
27#define DEF_FREQUENCY_DOWN_DIFFERENTIAL (10)
27#define DEF_FREQUENCY_UP_THRESHOLD (80) 28#define DEF_FREQUENCY_UP_THRESHOLD (80)
28#define MIN_FREQUENCY_UP_THRESHOLD (11) 29#define MIN_FREQUENCY_UP_THRESHOLD (11)
29#define MAX_FREQUENCY_UP_THRESHOLD (100) 30#define MAX_FREQUENCY_UP_THRESHOLD (100)
@@ -86,10 +87,12 @@ static struct workqueue_struct *kondemand_wq;
86static struct dbs_tuners { 87static struct dbs_tuners {
87 unsigned int sampling_rate; 88 unsigned int sampling_rate;
88 unsigned int up_threshold; 89 unsigned int up_threshold;
90 unsigned int down_differential;
89 unsigned int ignore_nice; 91 unsigned int ignore_nice;
90 unsigned int powersave_bias; 92 unsigned int powersave_bias;
91} dbs_tuners_ins = { 93} dbs_tuners_ins = {
92 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD, 94 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
95 .down_differential = DEF_FREQUENCY_DOWN_DIFFERENTIAL,
93 .ignore_nice = 0, 96 .ignore_nice = 0,
94 .powersave_bias = 0, 97 .powersave_bias = 0,
95}; 98};
@@ -424,9 +427,13 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
424 * can support the current CPU usage without triggering the up 427 * can support the current CPU usage without triggering the up
425 * policy. To be safe, we focus 10 points under the threshold. 428 * policy. To be safe, we focus 10 points under the threshold.
426 */ 429 */
427 if (max_load_freq < (dbs_tuners_ins.up_threshold - 10) * policy->cur) { 430 if (max_load_freq <
431 (dbs_tuners_ins.up_threshold - dbs_tuners_ins.down_differential) *
432 policy->cur) {
428 unsigned int freq_next; 433 unsigned int freq_next;
429 freq_next = max_load_freq / (dbs_tuners_ins.up_threshold - 10); 434 freq_next = max_load_freq /
435 (dbs_tuners_ins.up_threshold -
436 dbs_tuners_ins.down_differential);
430 437
431 if (!dbs_tuners_ins.powersave_bias) { 438 if (!dbs_tuners_ins.powersave_bias) {
432 __cpufreq_driver_target(policy, freq_next, 439 __cpufreq_driver_target(policy, freq_next,