From: Eric Piel <Eric.Piel@tremplin-utc.net>
To: Eric Piel <Eric.Piel@tremplin-utc.net>
Cc: davej@redhat.com, cpufreq@zenii.linux.org.uk,
alex-kernel@digriz.org.uk, Alexander Clouter <alex@digriz.org.uk>,
linux@dominikbrodowski.de
Subject: Re: [PATCH] (1/3) cpufreq_ondemand - 01_ignore-nice.diff
Date: Mon, 21 Feb 2005 11:20:51 +0100 [thread overview]
Message-ID: <4219B603.8050403@tremplin-utc.net> (raw)
In-Reply-To: <4218B768.8020401@tremplin-utc.net>
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]
Eric Piel a écrit :
> Alexander Clouter a écrit :
>
>> Adds support to cpufreq_ondemand to ignore 'nice' cpu time
>>
> IMO, this policy should be has lightweight as possible. Why not making
> this feature just hard-coded? Don't count the load that nice'd tasks do,
> period!
>
> It would make the patch 5 lines instead of 50. Every userspace deamon
> have this feature enabled by default, so this is a very reasonable
> trade-off.
>
Here is the patch, it does exactly the same functionality but it's
completly static and therefore much smaller. Just tested on my computer,
it does the trick.
Eric
--
Avoid the cpufreq ondemand governor to count the nice'd tasks as load
for the cpu.
cpufreq_ondemand.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
--
[-- Attachment #2: ondemand-ignore-nice-static.patch --]
[-- Type: text/x-patch, Size: 2197 bytes --]
--- linux-2.6.11-rc4/drivers/cpufreq/cpufreq_ondemand.c.bak 2005-02-06 23:35:41.000000000 +0100
+++ linux-2.6.11-rc4/drivers/cpufreq/cpufreq_ondemand.c 2005-02-21 11:10:26.000000000 +0100
@@ -253,7 +253,8 @@ static void dbs_check_cpu(int cpu)
/* Check for frequency increase */
total_idle_ticks = kstat_cpu(cpu).cpustat.idle +
- kstat_cpu(cpu).cpustat.iowait;
+ kstat_cpu(cpu).cpustat.iowait +
+ kstat_cpu(cpu).cpustat.nice;
idle_ticks = total_idle_ticks -
this_dbs_info->prev_cpu_idle_up;
this_dbs_info->prev_cpu_idle_up = total_idle_ticks;
@@ -269,7 +270,8 @@ static void dbs_check_cpu(int cpu)
j_dbs_info = &per_cpu(cpu_dbs_info, j);
/* Check for frequency increase */
total_idle_ticks = kstat_cpu(j).cpustat.idle +
- kstat_cpu(j).cpustat.iowait;
+ kstat_cpu(j).cpustat.iowait +
+ kstat_cpu(j).cpustat.nice;
tmp_idle_ticks = total_idle_ticks -
j_dbs_info->prev_cpu_idle_up;
j_dbs_info->prev_cpu_idle_up = total_idle_ticks;
@@ -297,7 +299,8 @@ static void dbs_check_cpu(int cpu)
return;
total_idle_ticks = kstat_cpu(cpu).cpustat.idle +
- kstat_cpu(cpu).cpustat.iowait;
+ kstat_cpu(cpu).cpustat.iowait +
+ kstat_cpu(cpu).cpustat.nice;
idle_ticks = total_idle_ticks -
this_dbs_info->prev_cpu_idle_down;
this_dbs_info->prev_cpu_idle_down = total_idle_ticks;
@@ -312,7 +315,8 @@ static void dbs_check_cpu(int cpu)
j_dbs_info = &per_cpu(cpu_dbs_info, j);
/* Check for frequency increase */
total_idle_ticks = kstat_cpu(j).cpustat.idle +
- kstat_cpu(j).cpustat.iowait;
+ kstat_cpu(j).cpustat.iowait +
+ kstat_cpu(j).cpustat.nice;
tmp_idle_ticks = total_idle_ticks -
j_dbs_info->prev_cpu_idle_down;
j_dbs_info->prev_cpu_idle_down = total_idle_ticks;
@@ -398,11 +402,10 @@ static int cpufreq_governor_dbs(struct c
j_dbs_info->cur_policy = policy;
j_dbs_info->prev_cpu_idle_up =
- kstat_cpu(j).cpustat.idle +
- kstat_cpu(j).cpustat.iowait;
j_dbs_info->prev_cpu_idle_down =
kstat_cpu(j).cpustat.idle +
- kstat_cpu(j).cpustat.iowait;
+ kstat_cpu(j).cpustat.iowait +
+ kstat_cpu(j).cpustat.nice;
}
this_dbs_info->enable = 1;
sysfs_create_group(&policy->kobj, &dbs_attr_group);
[-- 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-21 10:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-20 13:15 [PATCH] (1/3) cpufreq_ondemand - 01_ignore-nice.diff Alexander Clouter
2005-02-20 14:12 ` Arjan van de Ven
2005-02-20 14:51 ` Dominik Brodowski
2005-02-20 14:53 ` Dominik Brodowski
2005-02-20 18:14 ` Alexander Clouter
2005-02-20 20:59 ` PCS
2005-02-21 11:41 ` Bruno Ducrot
2005-02-20 16:14 ` Eric Piel
2005-02-21 10:20 ` Eric Piel [this message]
2005-02-21 10:27 ` Alexander Clouter
2005-02-21 12:58 ` Eric Piel
2005-02-21 15:54 ` Dominik Brodowski
2005-02-21 13:11 ` Stefan Seyfried
2005-02-21 13:31 ` Eric Piel
-- strict thread matches above, loose matches on Subject: below --
2005-02-21 18:05 Pallipadi, Venkatesh
2005-05-10 22:30 Alexander Clouter
2005-05-11 1:30 ` Dave Jones
2005-05-11 2:38 ` 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=4219B603.8050403@tremplin-utc.net \
--to=eric.piel@tremplin-utc.net \
--cc=alex-kernel@digriz.org.uk \
--cc=alex@digriz.org.uk \
--cc=cpufreq@zenii.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 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.