From: Ingo Molnar <mingo@kernel.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Alex Shi <alex.shi@intel.com>,
Suresh Siddha <suresh.b.siddha@intel.com>,
vincent.guittot@linaro.org, svaidy@linux.vnet.ibm.com,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [discussion]sched: a rough proposal to enable power saving in scheduler
Date: Wed, 22 Aug 2012 13:33:53 +0200 [thread overview]
Message-ID: <20120822113352.GA28247@gmail.com> (raw)
In-Reply-To: <20120822120027.7d04fd3a@pyramind.ukuu.org.uk>
* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > With deep enough C states it's rather relevant whether we
> > continue to burn +50W for a couple of more milliseconds or
> > not, and whether we have the right information from the
> > scheduler and timer subsystem about how long the next idle
> > period is expected to be and how bursty a given task is.
>
> 50W for 2mS here and there is an irrelevance compared with
> burning a continual half a watt due to the upstream tree lack
> some of the SATA power patches for example.
It can be more than an irrelevance if the CPU is saturated - say
a game running on a mobile device very commonly saturates the
CPU. A third of the energy is spent in the CPU, sometimes more.
> It's the classic "standby mode" problem - energy efficiency
> has time as a factor and there are a lot of milliseconds in 5
> hours. That means anything continually on rapidly dominates
> the problem space.
>
> > > PM means fixing the stack top to bottom, and its a whackamole
> > > game, each one you fix you find the next. You have to sort the
> > > entire stack from desktop apps to kernel.
> >
> > Moving 'policy' into user-space has been an utter failure,
> > mostly because there's not a single project/subsystem
> > responsible for getting a good result to users. This is why
> > I resist "policy should not be in the kernel" meme here.
>
> You *can't* fix PM in one place. [...]
Preferably one project, not one place - but at least don't go
down the false path of:
" Policy always belongs into user-space so the kernel can
continue to do a shitty job even for pieces it could
understand better ..."
My opinion is that it depends, and I also think that we are so
bad currently (on x86) that we can do little harm by trying to
do things better.
> [...] Power management is a top to bottom thing. It starts in
> the hardware and propogates right to the top of the user space
> stack.
Partly because it's misdesigned: in practice there's very little
true user policy about power saving:
- On mobile devices I almost never tweak policy as a user -
sometimes I override screen brightness but that's all (and
it's trivial compared to all the many other things that go
on).
- On a laptop I'd love to never have to tweak it either -
running fast when on AC and running efficient when on battery
is a perfectly fine life-time default for me.
90% of the "policy" comes with the *form factor* - i.e. it's
something the hardware and thus the kernel could intimately
know about.
Yes, there are exceptions and there are servers.
The mobile device user mostly *only cares about battery life*,
for a given amount of real utility provided by the device. The
"user policy" fetish here is a serious misunderstanding of how
it should all work. There arent millions of people out there
wanting to tweak the heck out of PM.
People prefer no knobs at all - they want good defaults and they
want at most a single, intuitive, actionable control to override
the automation in 1% of the usecases, such as screen brightness.
> A single stupid behaviour in a desktop app is all it needs to
> knock the odd hour or two off your battery life. Something is
> mundane as refreshing a bit of the display all the time
> keeping the GPU and CPU from sleeping well.
Even with highly powertop-optimized systems that have no such
app and have very low wakeup rates we still lag behind the
competition.
> Most distros haven't managed to do power management properly
> because it is this entire integration problem. Every single
> piece of the puzzle has to be in place before you get any
> serious gain.
Most certainly.
So why not move most pieces into one well-informed code domain
(the kernel) and only expose high level controls, instead of
expecting user-space to get it all right.
Then the 'only' job of user-space would be to not be silly when
implementing their functionality. (and there's nothing
intimately PM about that.)
> It's not a kernel v user thing. The kernel can't fix it,
> random bits of userspace can't fix it. This is effectively a
> "product level" integration problem.
Of course the kernel can fix many parts by offering automation
like automatically shutting down unused interfaces (and offering
better ABIs if that is not possible due to some poor historic
choice), choosing frequencies and C states wisely, etc.
Kernel design decisions *matter*:
Look for example how moving X lowlevel drivers from user-space
into kernel-space enabled GPU level power management to begin
with. With the old X method it was essentially impossible. Now
it's at least possible.
Or look at how Android adding a high-level interface like
suspend blockers materially improved the power saving situation
for them.
This learned helplessness that "the kernel can do nothing about
PM" is somewhat annoying :-)
Thanks,
Ingo
next prev parent reply other threads:[~2012-08-22 11:34 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 12:21 [discussion]sched: a rough proposal to enable power saving in scheduler Alex Shi
2012-08-14 7:35 ` Alex Shi
2012-08-15 8:23 ` Peter Zijlstra
2012-08-15 11:05 ` Peter Zijlstra
2012-08-15 13:15 ` Borislav Petkov
2012-08-15 14:43 ` Peter Zijlstra
2012-08-16 3:22 ` Alex Shi
2012-08-16 3:09 ` Alex Shi
2012-08-15 13:45 ` Arjan van de Ven
2012-08-15 14:39 ` Peter Zijlstra
2012-08-15 14:43 ` Arjan van de Ven
2012-08-15 15:04 ` Peter Zijlstra
2012-08-15 17:59 ` Arjan van de Ven
2012-08-20 8:06 ` Ingo Molnar
2012-08-20 8:26 ` Peter Zijlstra
2012-08-20 13:26 ` Arjan van de Ven
2012-08-20 18:16 ` Matthew Garrett
2012-08-21 9:42 ` Ingo Molnar
2012-08-21 11:39 ` Matthew Garrett
2012-08-21 15:19 ` Ingo Molnar
2012-08-21 15:21 ` Arjan van de Ven
2012-08-21 15:28 ` Matthew Garrett
2012-08-21 15:59 ` Ingo Molnar
2012-08-21 16:13 ` Matthew Garrett
2012-08-21 18:23 ` Ingo Molnar
2012-08-21 18:34 ` Matthew Garrett
2012-08-22 9:10 ` Ingo Molnar
2012-08-22 11:35 ` Matthew Garrett
2012-08-23 8:19 ` Alex Shi
2012-08-21 18:52 ` Alan Cox
2012-08-22 9:03 ` Ingo Molnar
2012-08-22 11:00 ` Alan Cox
2012-08-22 11:33 ` Ingo Molnar [this message]
2012-08-22 12:58 ` Alan Cox
2012-08-21 16:02 ` Alan Cox
2012-08-22 5:41 ` Mike Galbraith
2012-08-22 13:02 ` Arjan van de Ven
2012-08-22 13:09 ` Mike Galbraith
2012-08-22 13:21 ` Matthew Garrett
2012-08-22 13:23 ` Arjan van de Ven
2012-08-16 1:14 ` Rik van Riel
2012-08-16 1:17 ` Arjan van de Ven
2012-08-16 1:21 ` Arjan van de Ven
2012-08-15 14:19 ` Arjan van de Ven
2012-08-15 14:44 ` Peter Zijlstra
2012-08-15 14:47 ` Thomas Gleixner
2012-08-15 16:23 ` Matthew Garrett
2012-08-15 16:34 ` Matthew Garrett
2012-08-15 18:02 ` Arjan van de Ven
2012-08-17 8:59 ` Paul Turner
2012-08-16 3:07 ` Alex Shi
2012-08-16 6:53 ` preeti
2012-08-16 9:58 ` Alex Shi
2012-08-16 12:45 ` Shilimkar, Santosh
2012-08-16 14:01 ` Arjan van de Ven
2012-08-16 18:45 ` Rik van Riel
2012-08-16 19:20 ` Arjan van de Ven
2012-08-17 1:29 ` Alex Shi
2012-08-17 18:41 ` Matthew Garrett
2012-08-17 18:44 ` Arjan van de Ven
2012-08-17 18:47 ` Matthew Garrett
2012-08-17 19:45 ` Chris Friesen
2012-08-17 19:50 ` Matthew Garrett
2012-08-17 20:16 ` Chris Friesen
2012-08-18 14:33 ` Luming Yu
2012-08-18 14:52 ` Arjan van de Ven
2012-08-16 14:31 ` Morten Rasmussen
2012-08-19 10:12 ` Juri Lelli
2012-08-17 8:43 ` Paul Turner
2012-08-20 15:55 ` Vincent Guittot
2012-08-20 15:36 ` Vincent Guittot
2012-08-21 0:58 ` Alex Shi
2012-08-21 11:05 ` Vincent Guittot
2012-08-15 14:24 ` Rakib Mullick
2012-08-15 14:55 ` Peter Zijlstra
2012-08-15 22:58 ` Rakib Mullick
2012-08-16 5:26 ` Alex Shi
2012-08-16 4:57 ` Alex Shi
2012-08-16 8:05 ` Rakib Mullick
2012-08-15 16:19 ` Matthew Garrett
2012-08-16 5:03 ` Alex Shi
2012-08-16 5:31 ` Matthew Garrett
2012-08-16 5:39 ` Alex Shi
2012-08-16 5:45 ` Matthew Garrett
2012-08-16 13:57 ` Arjan van de Ven
2012-08-20 15:47 ` Christoph Lameter
2012-08-20 15:52 ` Matthew Garrett
2012-08-20 19:22 ` Christoph Lameter
2012-08-20 15:47 ` Vincent Guittot
2012-08-21 1:05 ` Alex Shi
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=20120822113352.GA28247@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alex.shi@intel.com \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=suresh.b.siddha@intel.com \
--cc=svaidy@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).