public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Linux-pm mailing list <linux-pm@lists.osdl.org>
Subject: Re: Toward runtime power management in Linux
Date: Thu, 25 Aug 2005 13:12:56 +1000	[thread overview]
Message-ID: <1124939576.7876.4.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0507302219250.13423-100000@netrider.rowland.org>

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


> RTPM core: The scheme described above doesn't necessarily involve the
> PM core.  The notifications can be simple subroutine calls, perhaps
> with support from the bus subsystem.  It's not obvious how much core
> support we will need for RTPM, apart from the sysfs interface.
> 
> Recursion: A consequence of doing things this way is that the
> notifications can potentially use a lot of stack space as they
> progress up the device tree.  (I can't think of any simple
> non-recursive technique for implementing the scheme.)  Fortunately
> this probably won't be too bad; the notifications will stop when they
> reach a device that doesn't want to change its state (because it has
> other children).  So the recursion should not involve too many levels.
> Still, it is something to watch out for.

I think the locking is unmanageable if we do synchronous notification. I
think devices should issue a "request for link state change" and be
asynchronously notified of the actual change, though they might be
allowed to block if they are doing that from process and/or probe()
context (most of the time). I think the actual tree walking should be
done by a separate thread. That simplifies locking tremendously by
suppressing most deadlock conditions.

Another problem is the whole racyness of tree & list walking vs.
add/remove. We try to work around it in various ways that I think can't
work. See the small thread about pci_walk_bus() on lkml that exposes
that kind of races vs. device removal. I think we really need to
indroduce proper iterator objects that get notified on removal.

Racing with device addition is a different issue altogether. It means we
may add devices to already-walked part of the tree, thus have
inconsistent states... unless drivers are made properly aware that the
link state may not be full-on at probe time and deal with that.

> Context: A relatively recent change to the driver model core added a
> semaphore to struct device, and we will want to hold this semaphore
> while making state changes.  This immediately implies that RTPM needs
> a process context to run in.  Should we have a kernel thread or work
> queue specially devoted to RTPM activities (idle autosuspend and so
> forth)?

Might help.

Ben.



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



  parent reply	other threads:[~2005-08-25  3:12 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
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 [this message]
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=1124939576.7876.4.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=stern@rowland.harvard.edu \
    /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