[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1293085026-18173-4-git-send-email-youquan.song@intel.com>
Date: Thu, 23 Dec 2010 14:17:03 +0800
From: Youquan Song <youquan.song@...el.com>
To: davej@...hat.com, cpufreq@...r.kernle.org
Cc: venki@...gle.com, arjan@...ux.intel.com, lenb@...nel.org,
suresh.b.siddha@...el.com, kent.liu@...el.com,
chaohong.guo@...el.com, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
Youquan Song <youquan.song@...ux.intel.com>,
Youquan Song <youquan.song@...el.com>
Subject: [PATCH 3/6] cpufreq: Add roll back non-sampling_window
When sampling window is set to default sampling rate, the sampling window will
roll back to orignal behaviour. The up_threshold and down_differential also set
to original ones.
Signed-off-by: Youquan Song <youquan.song@...el.com>
---
drivers/cpufreq/cpufreq_ondemand.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 87aec7f..5242d24 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -469,11 +469,24 @@ static ssize_t store_sampling_window(struct kobject *a, struct attribute *b,
if (input > 1000000)
input = 1000000;
- if (input < 10000)
- input = 10000;
+ if (input < dbs_tuners_ins.sampling_rate)
+ input = dbs_tuners_ins.sampling_rate;
mutex_lock(&dbs_mutex);
dbs_tuners_ins.sampling_window = input;
+ /* User set sampling window equal default sampling rate,
+ * It means that user want disable sampling window, so
+ * return to legacy sampling mode
+ * */
+ if (input == dbs_tuners_ins.sampling_rate) {
+ dbs_tuners_ins.up_threshold = MICRO_FREQUENCY_UP_THRESHOLD;
+ dbs_tuners_ins.down_differential =
+ MICRO_FREQUENCY_DOWN_DIFFERENTIAL;
+ } else {
+ dbs_tuners_ins.up_threshold = SAMPLING_WINDOW_UP_THRESHOLD;
+ dbs_tuners_ins.down_differential =
+ SAMPLING_WINDOW_DOWN_DIFFERENTIAL;
+ }
mutex_unlock(&dbs_mutex);
return count;
@@ -720,7 +733,8 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
}
}
- if (sampling_window_enable)
+ if (sampling_window_enable && (dbs_tuners_ins.sampling_window !=
+ dbs_tuners_ins.sampling_rate))
/* Get the average load in the lastest sampling window */
max_load_freq = get_load_freq_during_sampling_window(
this_dbs_info, max_load_freq,
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists