cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Clouter <alex@digriz.org.uk>
To: cpufreq@lists.linux.org.uk
Cc: davej@redhat.com, linux@dominikbrodowski.de, alex-kernel@digriz.org.uk
Subject: [PATCH] (2/3) cpufreq_ondemand - 02_check-rate-and-break-out.diff
Date: Sun, 20 Feb 2005 13:16:59 +0000	[thread overview]
Message-ID: <20050220131659.GC4495@inskipp> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 447 bytes --]

Prevents un-necessary cpufreq changes if we are already at min/max

Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk>

-- 
 _________________________________________ 
/ He who lives without folly is less wise \
\ than he believes.                       /
 ----------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

[-- Attachment #1.1.2: cpufreq_ondemand-2.6.11-rc3-mm2-02_check-rate-and-break-out.diff --]
[-- Type: text/plain, Size: 884 bytes --]

--- linux-2.6.11-rc3-mm2.orig/drivers/cpufreq/cpufreq_ondemand.c	2005-02-20 11:34:30.901742696 +0000
+++ linux-2.6.11-rc3-mm2/drivers/cpufreq/cpufreq_ondemand.c	2005-02-20 11:36:06.467214536 +0000
@@ -334,6 +334,10 @@
 			sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate);
 
 	if (idle_ticks < up_idle_ticks) {
+		/* if we are already at full speed then break out early */
+		if (policy->cur == policy->max)
+			return;
+		
 		__cpufreq_driver_target(policy, policy->max, 
 			CPUFREQ_RELATION_H);
 		down_skip[cpu] = 0;
@@ -387,6 +391,10 @@
 			sampling_rate_in_HZ(freq_down_sampling_rate);
 
 	if (idle_ticks > down_idle_ticks ) {
+		/* if we are already at the lowest speed then break out early */
+		if (policy->cur == policy->min)
+			return;
+		
 		freq_down_step = (5 * policy->max) / 100;
 
 		/* max freq cannot be less than 100. But who knows.... */

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

             reply	other threads:[~2005-02-20 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-20 13:16 Alexander Clouter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-10 22:31 [PATCH] (2/3) cpufreq_ondemand - 02_check-rate-and-break-out.diff Alexander Clouter

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=20050220131659.GC4495@inskipp \
    --to=alex@digriz.org.uk \
    --cc=alex-kernel@digriz.org.uk \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=linux@dominikbrodowski.de \
    /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