All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Bilski" <rafalbilski@interia.pl>
To: stefano ferri <ferriste@libero.it>
Cc: cpufreq@lists.linux.org.uk,
	Alexander Clouter <alex-kernel@digriz.org.uk>
Subject: Re: [Bug 8081] Conservative governor sets wrong and too high sampling rates
Date: Wed, 28 Feb 2007 20:39:57 +0100	[thread overview]
Message-ID: <45E5DA8D.1020802@interia.pl> (raw)
In-Reply-To: <JE5ZRP$B081F2DA00BA3B983E6C3095805551EA@libero.it>

> [...]
> With the new code you wrote the governor should satisfy more users. 
> [...]
> So now, if I have a default sampling rate of 199000, the min will be 19900... good
> Oops.. wrong calculus. With the original code of the kernel default is 1990000, 
> min with your patch will be 1/10, so 199000. Could you please align the 
> min values with that of ondemand? (for my processor is 99500). 
> It should be 1/20 of the default, and the min sampling rate 
> that one can set would be about 1/10 of second.
OK. Adjusted. 
>> OK. Patch below is touching only min value. It is for 2.6.20. Is it sufficent?
> 
> Yes, if it will be a change in the next release of the kernel!
If author of this governor will accept it then probably will.

Question to Alexander Clouter:
Is this patch/change acceptable?

---
 drivers/cpufreq/cpufreq_conservative.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -49,12 +49,11 @@
  * All times here are in uS.
  */
 static unsigned int 				def_sampling_rate;
+static unsigned int 				min_sampling_rate;
 #define MIN_SAMPLING_RATE_RATIO			(2)
 /* for correct statistics, we need at least 10 ticks between each measure */
 #define MIN_STAT_SAMPLING_RATE			\
 			(MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
-#define MIN_SAMPLING_RATE			\
-			(def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
 #define MAX_SAMPLING_RATE			(500 * def_sampling_rate)
 #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER	(1000)
 #define DEF_SAMPLING_DOWN_FACTOR		(1)
@@ -125,7 +124,7 @@ static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
 
 static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
 {
-	return sprintf (buf, "%u\n", MIN_SAMPLING_RATE);
+	return sprintf (buf, "%u\n", min_sampling_rate);
 }
 
 #define define_one_ro(_name) 					\
@@ -173,7 +172,7 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
 	ret = sscanf (buf, "%u", &input);
 
 	mutex_lock(&dbs_mutex);
-	if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) {
+	if (ret != 1 || input > MAX_SAMPLING_RATE || input < min_sampling_rate) {
 		mutex_unlock(&dbs_mutex);
 		return -EINVAL;
 	}
@@ -510,10 +509,13 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
 
 			def_sampling_rate = 10 * latency *
 					DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
-
 			if (def_sampling_rate < MIN_STAT_SAMPLING_RATE)
 				def_sampling_rate = MIN_STAT_SAMPLING_RATE;
 
+			min_sampling_rate = def_sampling_rate / 20;
+			if (min_sampling_rate < MIN_STAT_SAMPLING_RATE)
+				min_sampling_rate = MIN_STAT_SAMPLING_RATE;
+
 			dbs_tuners_ins.sampling_rate = def_sampling_rate;
 
 			dbs_timer_init();


----------------------------------------------------------------------
Oficjalne konto pocztowe europejskich internautow! 
>>> http://link.interia.pl/f19e8

  reply	other threads:[~2007-02-28 19:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28  8:33 [Bug 8081] Conservative governor sets wrong and too high sampling rates stefano ferri
2007-02-28 19:39 ` Rafał Bilski [this message]
2007-03-01 19:57   ` Alexander Clouter
     [not found] <bug-8081-3570@http.bugzilla.kernel.org/>
2007-06-21  0:04 ` bugme-daemon
2007-06-21  0:12 ` bugme-daemon
2007-08-17 22:41 ` bugme-daemon
2007-08-18  8:21 ` bugme-daemon
  -- strict thread matches above, loose matches on Subject: below --
2007-02-28 13:34 stefano ferri
2007-02-27 11:49 stefano ferri
2007-02-27 19:27 ` Rafał Bilski
2007-02-25 21:24 stefano ferri
2007-02-25 22:31 ` Rafał Bilski
2007-02-25 21:14 stefano ferri
2007-02-25 16:37 bugme-daemon
2007-02-25 20:29 ` Rafał Bilski

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=45E5DA8D.1020802@interia.pl \
    --to=rafalbilski@interia.pl \
    --cc=alex-kernel@digriz.org.uk \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=ferriste@libero.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.