diff options
author | venkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com> | 2008-08-04 14:59:10 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2008-10-09 13:52:44 -0400 |
commit | e9d95bf7eb929b9ddc9af9f4327b76c77ed4c7d6 (patch) | |
tree | 09206190529c527b36509830d735fc77e5cec74c /drivers/cpufreq | |
parent | 3430502d356284ff4f7782d75bb01a402fd3d45e (diff) |
[CPUFREQ][4/6] cpufreq_ondemand: Parameterize down differential
Use a parameter for down differential, instead of hardcoded 10%. Follow-on
patch changes the down-differential dynamically, based on whether
we are using idle micro-accounting or not.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 11 |
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; | |||
86 | static struct dbs_tuners { | 87 | static 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, |