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
Subject: Re: [Bug 8081] Conservative governor sets wrong and too high sampling rates
Date: Tue, 27 Feb 2007 20:27:44 +0100	[thread overview]
Message-ID: <45E48630.7060708@interia.pl> (raw)
In-Reply-To: <JE4E69$34CFDAE2EA17565934BFEA5A3CDD1785@libero.it>

> [...]
> Correcting that line of code I mentioned above one can choose a value between 0.0995 seconds and 9.95. I don't know what should I do with a maximum of 99.5...
Me too, but maybe there is someone using it. I don't see the reason to touch it.
> I hope we can agree a little on this... If you want the kernel 
> set a default value of 1 second ok, but let users free to set it 
> to a vrey lower value decreasing the value contained in sampling_rate_min.
I agree.
> [...]
> fan starts very rarely also with my version of conservative, ondemand, yes, makes it start for too much time.
> Why don't you try?
Current value is good for me.
>> [...]
> If the load is constant (as you said, when compiling) conservative increases 
> frequency, but it takes ten second to pass from 400 Mhz to 2133, 
> it's too much... The governor works but I think it's not very useful 
> for a desktop use if I am not free to set a sampling rate lower than a second...
It takes ten seconds for me too (66MHz step). It isn't probem for me. 
>> You are changing *default* value. If You don't like min value then change 
>> min value. I disagree with Your change because You are changing *powersaver* 
>> governor into step-by-step ondemand.
> 
> If you think, the default value can remain the same, 1 or 2 seconds as now, 
> but I would have the opportunity to set it to 0.1 seconds for example, while 
> my sampling_rate_min is 995000, it is not possible in this condition! 
> A conservative governor with the possibility to choose a lower sampling 
> rate could be useful. As you said, it would be a step-by-step ondemand.
OK. Patch below is touching only min value. It is for 2.6.20. Is it sufficent?
---
 drivers/cpufreq/cpufreq_conservative.c |   13 ++++++++-----
 1 files changed, 8 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,14 @@ 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 = latency *
+					DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
+			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-27 19:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 11:49 [Bug 8081] Conservative governor sets wrong and too high sampling rates stefano ferri
2007-02-27 19:27 ` Rafał Bilski [this message]
     [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-28  8:33 stefano ferri
2007-02-28 19:39 ` Rafał Bilski
2007-03-01 19:57   ` Alexander Clouter
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=45E48630.7060708@interia.pl \
    --to=rafalbilski@interia.pl \
    --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.