public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Leo L. Schwab" <ewhac@best.com>
To: linux-pm@lists.osdl.org
Subject: Re: Toward runtime power management in Linux
Date: Sun, 31 Jul 2005 19:10:55 -0700	[thread overview]
Message-ID: <20050801021054.GA30859@best.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0507302219250.13423-100000@netrider.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 3117 bytes --]

On Sat, Jul 30, 2005 at 10:36:56PM -0400, Alan Stern wrote:
> An example will make this clearer.  A PCI bridge is a parent, with a
> PCI device as its child.  The set of device states for both the parent and 
> the child is {D0, D1, D2, D3}.  (Maybe some variants of D3 for special
> situations; let's not worry about the details.)  The link states will
> also be D0 - D3.  When the child want to go from D0 to D3, it first
>                                                            ^^^^^^^^
> changes the device's actual state and then notifies the parent about
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> the link change.
> ^^^^^^^^^^^^^^^

	Strong disagreement.  Power state changes must be allowed to fail
("Spin up the 15K RPM drive?  I'm sorry, there's only 3 Watts of power left
to spare").  So you must first ask the parent for a power state change
before you perform your own so it has the opportunity to deny the request.
Besides, in the case of USB, you may not have any power at all until you
notify the parent bus/hub manager to wake up.

> These notifications are one-way, child-to-parent only.  We don't need
> pre- and post-notifications; each message will inform the parent of a
> single link-state change, which the parent will then carry out.

	I don't see how this will work.  Bringing up power/resuming must
happen in parent-to-child order, otherwise endpoint devices may not have any
power at all when you try to bring them up.  Cutting off power/suspending
must happen in child-to-parent order, since parents can't know when it's
safe to cut off power until the child is completely quiesced.

> Idle-timeout RTPM: We certainly should have an API whereby userspace
> can inform the kernel of an idle-timeout value to use for
> autosuspending.  (In principle there could be multiple timeout values,
> for successively deeper levels of power saving.)  This cries out to be
> managed in a centralized way rather than letting each driver have its
> own API.  It's not so clear what the most efficient implementation
> will be.  Should every device have its own idle-timeout kernel timer?
> (That's a lot of kernel timers.)

	Whether you do it in user space or kernel space, you're going to
potentially schedule a lot of timers.

> Or should the RTPM kernel thread
> wake up every second to scan a list of devices that may have exceeded
> their idle timeouts?
>
	This could potentially make performance-conscious apps "hiccup"
once every second as this thread goes walking the list looking for
candidates to shut off.  Try to avoid this; if nothing is happening, nothing
should be running.

> Userspace support: It's easy to see how userspace could use sysfs to
> request a single device state change.  But what if the user wants to
> suspend an entire subtree?  [ ... ]

	If you wanted to get really fancy, you could establish via a
userspace API a named "device collection" which acts as a virtual device.
You then apply the state change to the device collection, and the kernel
percolates it through all the actual devices, taking locking into account.

					Schwab

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



  reply	other threads:[~2005-08-01  2:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-31  2:36 Toward runtime power management in Linux Alan Stern
2005-08-01  2:10 ` Leo L. Schwab [this message]
2005-08-01 11:44   ` Amit Kucheria
2005-08-01 14:16     ` Alan Stern
     [not found]     ` <20050802024415.C3518DB57B@adsl-69-107-32-110.dsl.pltn13.pacbell.net>
2005-08-04  8:06       ` Tony Lindgren
2005-08-04 16:02         ` david-b
2005-08-14 19:53         ` Pavel Machek
2005-08-01 14:07   ` Alan Stern
2005-08-01 15:10     ` Jordan Crouse
2005-08-01 15:23       ` Alan Stern
2005-08-04 17:24     ` Igor Stoppa
     [not found] ` <Pine.LNX.4.50.0508011712220.2764-100000@monsoon.he.net>
2005-08-02 17:45   ` Geoff Levand
2005-08-25  3:12 ` Benjamin Herrenschmidt
2005-08-25 15:27   ` Alan Stern
2005-08-25 21:42     ` Benjamin Herrenschmidt
2005-08-26  2:25       ` Alan Stern
     [not found] <Pine.LNX.4.50.0508012316380.2764-100000@monsoon.he.net>
2005-08-02 14:35 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2005-08-25 13:59 Brown, Len

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=20050801021054.GA30859@best.com \
    --to=ewhac@best.com \
    --cc=linux-pm@lists.osdl.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