From: Eric Piel <Eric.Piel@tremplin-utc.net>
To: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Cc: cpufreq@zenii.linux.org.uk, "Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH] ondemand governor clean-ups
Date: Mon, 07 Feb 2005 22:03:37 +0100 [thread overview]
Message-ID: <4207D7A9.807@tremplin-utc.net> (raw)
In-Reply-To: <88056F38E9E48644A0F562A38C64FB6003F34484@scsmsx403.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 972 bytes --]
Pallipadi, Venkatesh wrote:
>
>
> Hi,
>
> Thanks for the patch. Looks good. Can you also remove the #define for
> sampling_rate_in_HZ, as it is no longer required.
Oops, I had done it but it went wrong when doing the patch. My second
tried is attached :-)
Eric
>
>>-----Original Message-----
>>From: Eric Piel [mailto:Eric.Piel@tremplin-utc.net]
>>Sent: Sunday, February 06, 2005 3:06 PM
>>To: Pallipadi, Venkatesh; Nakajima, Jun
>>Cc: cpufreq@ZenII.linux.org.uk
>>Subject: [PATCH] ondemand governor clean-ups
>>
>>Hello,
>>
>>Having a look at the ondemand governor I noticed some possible trivial
>>and minimal clean-ups.
>>
>>Here they are:
>>- change from sampling_rate_in_HZ() to the official function
>>usecs_to_jiffies().
>>- use for_each_online_cpu() to instead of using "if (cpu_online(i))"
>>
>>Those are just trivial clean-ups, please apply,
>>Eric
Oops,
--
Trivial ondemand governor clean-ups
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
--
[-- Attachment #2: ondemand-cleanup-macro-2.6.11-rc3.patch --]
[-- Type: text/x-patch, Size: 1957 bytes --]
--- linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c.bak 2005-02-06 23:35:41.000000000 +0100
+++ linux-2.6.11-rc3/drivers/cpufreq/cpufreq_ondemand.c 2005-02-07 21:45:18.000000000 +0100
@@ -57,7 +57,6 @@ static unsigned int def_sampling_rat
#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
#define DEF_SAMPLING_DOWN_FACTOR (10)
#define TRANSITION_LATENCY_LIMIT (10 * 1000)
-#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))
static void do_dbs_timer(void *data);
@@ -281,7 +280,7 @@ static void dbs_check_cpu(int cpu)
/* Scale idle ticks by 100 and compare with up and down ticks */
idle_ticks *= 100;
up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate);
+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
if (idle_ticks < up_idle_ticks) {
__cpufreq_driver_target(policy, policy->max,
@@ -328,7 +327,7 @@ static void dbs_check_cpu(int cpu)
freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
dbs_tuners_ins.sampling_down_factor;
down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *
- sampling_rate_in_HZ(freq_down_sampling_rate);
+ usecs_to_jiffies(freq_down_sampling_rate);
if (idle_ticks > down_idle_ticks ) {
freq_down_step = (5 * policy->max) / 100;
@@ -348,11 +347,10 @@ static void do_dbs_timer(void *data)
{
int i;
down(&dbs_sem);
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_online(i))
- dbs_check_cpu(i);
+ for_each_online_cpu(i)
+ dbs_check_cpu(i);
schedule_delayed_work(&dbs_work,
- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
up(&dbs_sem);
}
@@ -360,7 +358,7 @@ static inline void dbs_timer_init(void)
{
INIT_WORK(&dbs_work, do_dbs_timer, NULL);
schedule_delayed_work(&dbs_work,
- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
return;
}
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
next prev parent reply other threads:[~2005-02-07 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-07 18:47 [PATCH] ondemand governor clean-ups Pallipadi, Venkatesh
2005-02-07 21:03 ` Eric Piel [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-02-07 21:15 Pallipadi, Venkatesh
2005-02-06 23:06 Eric Piel
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=4207D7A9.807@tremplin-utc.net \
--to=eric.piel@tremplin-utc.net \
--cc=cpufreq@zenii.linux.org.uk \
--cc=jun.nakajima@intel.com \
--cc=venkatesh.pallipadi@intel.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