cpufreq.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: venkatesh.pallipadi@intel.com
To: cpufreq@www.linux.org.uk
Cc: davej@redhat.com
Subject: [patch 4/6] cpufreq_ondemand: Parameterize down differential
Date: Thu, 17 Jul 2008 13:55:58 -0700	[thread overview]
Message-ID: <20080717205616.373739000@intel.com> (raw)
In-Reply-To: 20080717205554.214645000@intel.com

[-- Attachment #1: add_down_differential.patch --]
[-- Type: text/plain, Size: 2007 bytes --]

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>

---
 drivers/cpufreq/cpufreq_ondemand.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/cpufreq/cpufreq_ondemand.c
===================================================================
--- linux-2.6.orig/drivers/cpufreq/cpufreq_ondemand.c	2008-07-17 13:12:26.000000000 -0700
+++ linux-2.6/drivers/cpufreq/cpufreq_ondemand.c	2008-07-17 13:17:06.000000000 -0700
@@ -24,6 +24,7 @@
  * It helps to keep variable names smaller, simpler
  */
 
+#define DEF_FREQUENCY_DOWN_DIFFERENTIAL		(10)
 #define DEF_FREQUENCY_UP_THRESHOLD		(80)
 #define MIN_FREQUENCY_UP_THRESHOLD		(11)
 #define MAX_FREQUENCY_UP_THRESHOLD		(100)
@@ -86,10 +87,12 @@ static struct workqueue_struct	*kondeman
 static struct dbs_tuners {
 	unsigned int sampling_rate;
 	unsigned int up_threshold;
+	unsigned int down_differential;
 	unsigned int ignore_nice;
 	unsigned int powersave_bias;
 } dbs_tuners_ins = {
 	.up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
+	.down_differential = DEF_FREQUENCY_DOWN_DIFFERENTIAL,
 	.ignore_nice = 0,
 	.powersave_bias = 0,
 };
@@ -424,9 +427,13 @@ static void dbs_check_cpu(struct cpu_dbs
 	 * can support the current CPU usage without triggering the up
 	 * policy. To be safe, we focus 10 points under the threshold.
 	 */
-	if (max_load_freq < (dbs_tuners_ins.up_threshold - 10) * policy->cur) {
+	if (max_load_freq <
+	    (dbs_tuners_ins.up_threshold - dbs_tuners_ins.down_differential) *
+	     policy->cur) {
 		unsigned int freq_next;
-		freq_next = max_load_freq / (dbs_tuners_ins.up_threshold - 10);
+		freq_next = max_load_freq /
+				(dbs_tuners_ins.up_threshold -
+				 dbs_tuners_ins.down_differential);
 
 		if (!dbs_tuners_ins.powersave_bias) {
 			__cpufreq_driver_target(policy, freq_next,

-- 

  parent reply	other threads:[~2008-07-17 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 20:55 [patch 0/6] cpufreq: Use idle micro-accounting information in ondemand governor venkatesh.pallipadi
2008-07-17 20:55 ` [patch 1/6] cpufreq: Add cpu number parameter to __cpufreq_driver_getavg() venkatesh.pallipadi
2008-07-17 20:55 ` [patch 2/6] cpufreq: Change load calculation in ondemand for software coordination venkatesh.pallipadi
2008-07-17 20:55 ` [patch 3/6] cpufreq: get_cpu_idle_time() changes in ondemand to suit idle-microaccounting venkatesh.pallipadi
2008-07-17 20:55 ` venkatesh.pallipadi [this message]
2008-07-17 20:55 ` [patch 5/6] cpufreq: Changes to get_cpu_idle_time_us(), to be used in ondemand governor venkatesh.pallipadi
2008-07-17 20:56 ` [patch 6/6] cpufreq: Add idle microaccounting " venkatesh.pallipadi
2008-07-30 16:56 ` [patch 0/6] cpufreq: Use idle micro-accounting information " Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080717205616.373739000@intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=cpufreq@www.linux.org.uk \
    --cc=davej@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).