login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
May
»
4
Re: [PATCH 8/7] cpufreq: make the iowait-is-busy-time a sysfs tunable
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Pavel Machek
Subject:
Re: [PATCH 8/7] cpufreq: make the iowait-is-busy-time a sysfs tunable
Date: Monday, May 3, 2010 - 10:43 pm
On Mon 2010-05-03 20:48:18, Arjan van de Ven wrote:
quoted text
> On Tue, 27 Apr 2010 13:39:34 +0200 > Thomas Renninger <trenn@suse.de> wrote: > > > On Friday 23 April 2010 06:08:19 pm Arjan van de Ven wrote: > > > On Fri, 23 Apr 2010 10:50:10 +0200 > > > Thomas Renninger <trenn@suse.de> wrote: > > > Especially on battery, users will appreciate some minutes > > > > > > > of more battery lifetime and do not care about some ms of IO > > > > latencies. > > > > > > the assumption that power doesn't matter on AC is a huge fiction > > > that any data center operator would love to get out of everyones > > > head as quickly as possible. > > > > Have I said power doesn't matter on AC? > > Do you agree that a datacenter has different performance vs power > > tradeoff demands as a battery driven mobile device? > > > > Back to the topic: > > As you did not answer on my (several) sysfs knob request(s), I expect > > you agree with it and will add one. > > > > yup it makes sense to have a sysfs knob with a sane default value > > From: Arjan van de Ven <arjan@linux.intel.com> > Subject: [PATCH] cpufreq: make the iowait-is-busy-time a sysfs tunable > > Pavel Machek pointed out that not all CPUs have an efficient idle > at high frequency. Specifically, older Intel and various AMD cpus > would get a higher power usage when copying files from USB. > > Mike Chan pointed out that the same is true for various ARM chips > as well. > > Thomas Renninger suggested to make this a sysfs tunable with a > reasonable default. > > This patch adds a sysfs tunable for the new behavior, and uses > a very simple function to determine a reasonable default, depending > on the CPU vendor/type. > > Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
ACK.
quoted text
> --- > drivers/cpufreq/cpufreq_ondemand.c | 46 +++++++++++++++++++++++++++++++++++- > 1 files changed, 45 insertions(+), 1 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c > index ed472f8..4877e8f 100644 > --- a/drivers/cpufreq/cpufreq_ondemand.c > +++ b/drivers/cpufreq/cpufreq_ondemand.c > @@ -109,6 +109,7 @@ static struct dbs_tuners { > unsigned int down_differential; > unsigned int ignore_nice; > unsigned int powersave_bias; > + unsigned int io_is_busy; > } dbs_tuners_ins = { > .up_threshold = DEF_FREQUENCY_UP_THRESHOLD, > .down_differential = DEF_FREQUENCY_DOWN_DIFFERENTIAL, > @@ -260,6 +261,7 @@ static ssize_t show_##file_name \ > return sprintf(buf, "%u\n", dbs_tuners_ins.object); \ > } > show_one(sampling_rate, sampling_rate); > +show_one(io_is_busy, io_is_busy); > show_one(up_threshold, up_threshold); > show_one(ignore_nice_load, ignore_nice); > show_one(powersave_bias, powersave_bias); > @@ -310,6 +312,22 @@ static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b, > return count; > } > > +static ssize_t store_io_is_busy(struct kobject *a, struct attribute *b, > + const char *buf, size_t count) > +{ > + unsigned int input; > + int ret; > + ret = sscanf(buf, "%u", &input); > + if (ret != 1) > + return -EINVAL; > + > + mutex_lock(&dbs_mutex); > + dbs_tuners_ins.io_is_busy = !!input; > + mutex_unlock(&dbs_mutex); > + > + return count; > +} > + > static ssize_t store_up_threshold(struct kobject *a, struct attribute *b, > const char *buf, size_t count) > { > @@ -392,6 +410,7 @@ static struct global_attr _name = \ > __ATTR(_name, 0644, show_##_name, store_##_name) > > define_one_rw(sampling_rate); > +define_one_rw(io_is_busy); > define_one_rw(up_threshold); > define_one_rw(ignore_nice_load); > define_one_rw(powersave_bias); > @@ -403,6 +422,7 @@ static struct attribute *dbs_attributes[] = { > &up_threshold.attr, > &ignore_nice_load.attr, > &powersave_bias.attr, > + &io_is_busy.attr, > NULL > }; > > @@ -527,7 +547,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) > * from the cpu idle time. > */ > > - if (idle_time >= iowait_time) > + if (dbs_tuners_ins.io_is_busy && idle_time >= iowait_time) > idle_time -= iowait_time; > > if (unlikely(!wall_time || wall_time < idle_time)) > @@ -643,6 +663,29 @@ static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) > cancel_delayed_work_sync(&dbs_info->work); > } > > +/* > + * Not all CPUs want IO time to be accounted as busy; this depends on how > + * efficient idling at a higher frequency/voltage is. > + * Pavel Machek says this is not so for various generations of AMD and old > + * Intel systems. > + * Mike Chan (android.com) says this is also not true for ARM. > + * Because of this, whitelist specific known (series) of CPUs by default, and > + * leave all others up to the user. > + */ > +static int should_io_be_busy(void) > +{ > +#if defined(CONFIG_X86) > + /* > + * For Intel, Core 2 (model 15) and later have an efficient idle. > + */ > + if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && > + boot_cpu_data.x86 == 6 && > + boot_cpu_data.x86_model >= 15) > + return 1; > +#endif > + return 0; > +} > + > static int cpufreq_governor_dbs(struct cpufreq_policy *policy, > unsigned int event) > { > @@ -705,6 +748,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, > dbs_tuners_ins.sampling_rate = > max(min_sampling_rate, > latency * LATENCY_MULTIPLIER); > + dbs_tuners_ins.io_is_busy = should_io_be_busy(); > } > mutex_unlock(&dbs_mutex); >
-- (english)
http://www.livejournal.com/~pavelmachek
(cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/7] Fix performance issue with ondemand governor
, Arjan van de Ven
, (Sun Apr 18, 11:59 am)
[PATCH 1/7] sched: add a comment to get_cpu_idle_time_us()
, Arjan van de Ven
, (Sun Apr 18, 12:00 pm)
[PATCH 2/7] sched: introduce a function to update the idle ...
, Arjan van de Ven
, (Sun Apr 18, 12:01 pm)
[PATCH 3/7] sched: update the idle statistics in get_cpu_i ...
, Arjan van de Ven
, (Sun Apr 18, 12:01 pm)
[PATCH 4/7] sched: fold updating of the last update time i ...
, Arjan van de Ven
, (Sun Apr 18, 12:02 pm)
[PATCH 5/7] sched: eliminate the ts->idle_lastupdate field
, Arjan van de Ven
, (Sun Apr 18, 12:02 pm)
[PATCH 6/7] sched: introduce get_cpu_iowait_time_us()
, Arjan van de Ven
, (Sun Apr 18, 12:03 pm)
[PATCH 7/7] ondemand: Solve the big performance issue with ...
, Arjan van de Ven
, (Sun Apr 18, 12:03 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Éric Piel
, (Mon Apr 19, 1:29 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Tvrtko Ursulin
, (Mon Apr 19, 2:09 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Mon Apr 19, 6:43 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Mon Apr 19, 6:46 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Éric Piel
, (Mon Apr 19, 7:30 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Mon Apr 19, 7:47 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Tvrtko Ursulin
, (Mon Apr 19, 8:29 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Mon Apr 19, 5:47 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Tvrtko Ursulin
, (Tue Apr 20, 2:10 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Thomas Renninger
, (Tue Apr 20, 2:24 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Thomas Renninger
, (Tue Apr 20, 2:29 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Tue Apr 20, 4:02 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Tue Apr 20, 4:07 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Pavel Machek
, (Thu Apr 22, 10:24 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Pavel Machek
, (Thu Apr 22, 10:26 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Willy Tarreau
, (Thu Apr 22, 10:38 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Pavel Machek
, (Fri Apr 23, 1:38 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Thomas Renninger
, (Fri Apr 23, 1:50 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Fri Apr 23, 6:52 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Fri Apr 23, 7:10 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Willy Tarreau
, (Fri Apr 23, 8:35 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Fri Apr 23, 9:06 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Fri Apr 23, 9:08 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Pavel Machek
, (Fri Apr 23, 9:56 pm)
Re: [PATCH 1/7] sched: add a comment to get_cpu_idle_time_us()
, Rik van Riel
, (Mon Apr 26, 12:25 pm)
Re: [PATCH 2/7] sched: introduce a function to update the ...
, Rik van Riel
, (Mon Apr 26, 1:11 pm)
Re: [PATCH 3/7] sched: update the idle statistics in get_c ...
, Rik van Riel
, (Mon Apr 26, 1:36 pm)
Re: [PATCH 4/7] sched: fold updating of the last update ti ...
, Rik van Riel
, (Mon Apr 26, 1:58 pm)
Re: [PATCH 5/7] sched: eliminate the ts->idle_lastupdate field
, Rik van Riel
, (Mon Apr 26, 2:00 pm)
Re: [PATCH 6/7] sched: introduce get_cpu_iowait_time_us()
, Rik van Riel
, (Mon Apr 26, 2:05 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Rik van Riel
, (Mon Apr 26, 2:30 pm)
Re: [PATCH 0/7] Fix performance issue with ondemand governor
, Dave Jones
, (Mon Apr 26, 2:41 pm)
Re: [PATCH 0/7] Fix performance issue with ondemand governor
, Dominik Brodowski
, (Mon Apr 26, 2:45 pm)
Re: [PATCH 0/7] Fix performance issue with ondemand governor
, Rik van Riel
, (Mon Apr 26, 2:59 pm)
Re: [PATCH 0/7] Fix performance issue with ondemand governor
, Dominik Brodowski
, (Mon Apr 26, 3:05 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Mike Chan
, (Mon Apr 26, 5:29 pm)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Thomas Renninger
, (Tue Apr 27, 4:39 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Pavel Machek
, (Tue Apr 27, 6:01 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Mike Chan
, (Tue Apr 27, 11:10 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Tvrtko Ursulin
, (Wed Apr 28, 1:57 am)
Re: [PATCH 7/7] ondemand: Solve the big performance issue ...
, Arjan van de Ven
, (Sat May 1, 4:29 pm)
[PATCH 8/7] cpufreq: make the iowait-is-busy-time a sysfs ...
, Arjan van de Ven
, (Mon May 3, 8:48 pm)
Re: [PATCH 8/7] cpufreq: make the iowait-is-busy-time a sy ...
, Willy Tarreau
, (Mon May 3, 9:16 pm)
Re: [PATCH 8/7] cpufreq: make the iowait-is-busy-time a sy ...
, Pavel Machek
, (Mon May 3, 10:43 pm)
Re: [PATCH 8/7] cpufreq: make the iowait-is-busy-time a sy ...
, Rik van Riel
, (Tue May 4, 6:51 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Frederic Weisbecker
[PATCH v2] struct sort_entry has a callback named snprintf that turns an entry int...
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Jens Axboe
Re: [BUG] Linux 2.6.25-rc2 - Regression from 2.6.24-rc1-git1 softlockup while bo...
Andrew Morton
Re: [PATCH v3 0/4] Introduce hardware spinlock framework
Ingo Molnar
Re: [GIT PULL] time.c - respin
git
:
Mark Junker
git on MacOSX and files with decomposed utf-8 file names
Junio C Hamano
Re: git-svnimport
Michal Sojka
[PATCHv5 1/2] filter-branch: Fix to allow replacing submodules with another content
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Ursula Braun
[patch 2/8] [PATCH] af_iucv: sync sk shutdown flag if iucv path is quiesced
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
git-commits-head
:
Linux Kernel Mailing List
ARM: S3C64XX: DMA: Callback with correct buffer pointer
Linux Kernel Mailing List
sata_mv: drop unncessary EH callback resetting
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
openbsd-misc
:
Rene Maroufi
smtpd: Aliases only work with for local alias aliases
Stephen J. Bevan
GRE over IPsec
Christophe Rioux
Implementation example of snmp
Darrin Chandler
Re: strange output on openbsd C code
Nick Holland
Re: booting openbsd on eee without cd-rom
Colocation donated by:
Syndicate