public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: scott.preece@motorola.com, matthew.a.locke@comcast.net,
	linux-pm@lists.osdl.org, pavel@ucw.cz
Subject: Re: So, what's the status on the recent patches here?
Date: Tue, 5 Sep 2006 12:31:58 +0200	[thread overview]
Message-ID: <200609051231.59356.rjw@sisk.pl> (raw)
In-Reply-To: <200609032300.k83N0uL6016830@olwen.urbana.css.mot.com>

On Monday, 4 September 2006 01:00, Scott E. Preece wrote:
> 
> | From: "Rafael J. Wysocki" <rjw@sisk.pl>
> | 
> | On Sunday, 3 September 2006 23:34, Scott E. Preece wrote:
> | > 
> | > | From: "Rafael J. Wysocki" <rjw@sisk.pl>
> | > | 
> | > | On Sunday, 3 September 2006 18:25, David Singleton wrote:
> | > | > On 9/2/06, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> | > | > >
> | > | > > That depends on the definition, but I think of suspend states as the ones
> | > | > > that require processes to be frozen before they can be entered.  IMHO it is
> | > | > > quite clear that such states cannot be handled in the same way as those
> | > | > > that do not require the freezing of processes, so they are not the same.
> | > | > 
> | > | > You are correct, processes do need to be frozen before a suspend.
> | > | > That's the prepare to suspend part of the suspend process, and
> | > | > the transtition is the suspending and finish is the un-freezing
> | > | > of the processes to resume execution.
> | > | > 
> | > | > And those same steps are the same steps required to transition the
> | > | > system to a new operating point, whether it's suspend or change
> | > | > from 1.4GHz to 600MHz.
> | > | 
> | > | There are only a few states that require the processes to be frozen and I
> | > | think that's a good enough reason to handle them separately.
> | > 
> | > ---
> | > 
> | > But, surely that distinction can be handled in the implementation behind
> | > the interface, rather than exsposed in the interface.
> | 
> | I don't think you can handle that behind the interface in a satisfactory way.
> | For example during a suspend to disk we carry out several transitions of
> | devices within the suspend-resume cycle.
> | 
> | > Does that distinction matter to the policy manager?
> | 
> | I think so.
> | 
> | > I would argue that it 
> | > increases the latency, which would be important to the policy manager,
> | > but that the nature of the latency isn't important to making a policy
> | > decision,  and the proposed interface already exposes the latency as
> | > something that can be used in making transition decisions.
> | 
> | From the policy manager perspective it may be just a latency fator,
> | but for all of the things _outside_ of the policy manager it's much more
> | than that.
> | 
> | For example transitions like a CPU frequency change are transparent for kernel
> | threads, but the suspend "transitions" are not, because the kernel threads need
> | to be informed that the system is suspending and they are expected to freeze
> | themselves voluntarily.
> | 
> | Really, I think that the "states" which are entered only after tasks are
> | frozen should be considered as special and handled separately.
> ---
> 
> My point is that if the only kernel interface is set-op(), then the code
> in the kernel that implements set-op() is the thing that's going to
> drive the details of suspending the system, just as it does today.

It's not exactly correct in the case of the userland suspend when we have
a userland process that drives the suspend (eg. it writes the suspend image
to a storage).  In that case the kernel is only asked to performe some
well defined atomic actions and not the entire transition.

> The abstraction at the kernel interface is about as simple as it can be and
> all the policy issues are moved outside the kernel.
> 
> My question is whether there are aspects of suspending, other than
> latency, that the policy manager would need to consider in deciding
> whether to suspend or not.
> 
> Look at it this way. In one scheme the policy manager code is:
> 
>    new_OP = select_transition(current_OP, decision_factors);
>    set_OP(new_OP);
> 
> in the other the policy manager code is:
> 
>    new_OP = select_transition(current_OP, decision_factors);
>    if (new_OP == SUSPEND)
>       suspend();
>    else
>       set_OP(new_OP);
> 
> The only practical difference is whether the kernel has one interface or
> two; in the one-interface case, there's code in the kernel's
> implementation of set_OP() that does the same conditional and calls the
> same implementation of suspend. In Pavel's preferred idiom, the calls
> to set_OP() are replaced by a sequence of
> 
>    set_power_parameter(PARM, VALUE) calls
> 
> All dreadfully oversimplified, of course, but I know that the general
> approach is possible, because our PM subsystem works in a vaguely
> similar manner. The simplification isn't completely ignorable, though,
> because the mechanisms driving the transitions involve input from the
> kernel (entry to idle, interrupts, clock events, load information, etc.).
> The interaction between the kernel and the policy manager may actually
> be too complex to support doing all of policy management in user space
> (our implementation actually has some kernel bits and some user-spec
> bits). Not sure that affects the question of whether suspend is an
> operating point, though - that seems (to me) to work the same whether
> the policy decision is in the kernel or in user space.
> 
> The one question that I see as interesting on that score is whether the
> policy decision to suspend is based on factors that are wholly different
> than the factors that drive frequency/voltage changes. If that were the
> case, then there would be no point to making the decisions in the same
> place.  Honestly, I'm not sure of the answer to that...

I think the decision to suspend is made
a) by the user,
b) by a policy manager in case when, for example, the battery is running
critical (ie. on emergency).
and the decision to change a frequency/voltage is usually based on some
efficiency factors.

Also, the suspend "transitions" are never transparent to the user and the
changes of frequency/voltage usually are, at least as far as CPUs are
concerned.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
		R. Buckminster Fuller

  parent reply	other threads:[~2006-09-05 10:31 UTC|newest]

Thread overview: 136+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-03 23:00 So, what's the status on the recent patches here? Scott E. Preece
2006-09-04  9:12 ` Pavel Machek
2006-09-05 10:31 ` Rafael J. Wysocki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-05 16:03 Scott E. Preece
2006-09-05 20:42 ` Rafael J. Wysocki
2006-09-06 10:56 ` Pavel Machek
2006-09-04 15:43 Scott E. Preece
2006-09-03 23:05 Scott E. Preece
2006-09-04  9:09 ` Pavel Machek
2006-09-03 22:40 Scott E. Preece
2006-09-04  9:06 ` Pavel Machek
2006-09-05 16:45   ` Mark Gross
2006-09-06 10:59     ` Pavel Machek
2006-09-03 22:31 Scott E. Preece
2006-09-03 22:41 ` Pavel Machek
2006-09-03 22:12 Scott E. Preece
2006-09-03 22:25 ` Pavel Machek
2006-09-03 21:34 Scott E. Preece
2006-09-03 21:43 ` Pavel Machek
2006-09-03 22:10 ` Rafael J. Wysocki
2006-09-03 21:21 Scott E. Preece
2006-09-03 21:54 ` Pavel Machek
2006-09-01 14:49 Scott E. Preece
2006-08-31 15:14 Scott E. Preece
2006-08-31  2:41 Woodruff, Richard
2006-08-31  0:52 Scott E. Preece
2006-08-25 22:11 Woodruff, Richard
2006-08-25 21:21 Woodruff, Richard
2006-08-25 21:42 ` Alan Stern
2006-08-25 20:57 Woodruff, Richard
2006-08-25 21:13 ` Alan Stern
2006-08-25 20:22 Woodruff, Richard
2006-08-25 20:34 ` Alan Stern
2006-08-25 21:27   ` Pavel Machek
2006-08-25 21:46     ` Alan Stern
2006-08-25 22:03       ` Pavel Machek
2006-08-26  2:21         ` Alan Stern
2006-08-25 20:05 Woodruff, Richard
2006-08-25 20:08 ` Pavel Machek
2006-08-24 14:52 Woodruff, Richard
2006-08-25 19:58 ` Pavel Machek
2006-08-24 12:16 Woodruff, Richard
2006-08-24 12:29 ` Pavel Machek
2006-08-23 19:20 Woodruff, Richard
2006-08-24  8:03 ` Pavel Machek
2006-08-20 13:36 Woodruff, Richard
2006-08-16  1:27 Scott E. Preece
2006-08-16 15:25 ` Mark Gross
2006-08-14 20:07 Greg KH
2006-08-14 22:24 ` Matthew Locke
2006-08-14 22:46   ` Dave Jones
2006-08-14 23:24     ` Matthew Locke
2006-08-14 23:48       ` Dave Jones
2006-08-15  1:00         ` Greg KH
2006-08-15  3:03           ` Dave Jones
2006-08-15 10:35           ` Amit Kucheria
2006-08-15 19:04             ` Dave Jones
2006-08-16 12:58               ` Igor Stoppa
2006-08-17 21:39                 ` Pavel Machek
2006-08-18 10:02                   ` Igor Stoppa
2006-08-18 15:29                     ` Alexey Starikovskiy
2006-08-18 17:54                       ` Igor Stoppa
2006-08-18 21:05                         ` Alexey Starikovskiy
2006-08-20 13:19                           ` Igor Stoppa
2006-08-17  5:20               ` Matthew Locke
2006-08-17  7:20                 ` Paul Mundt
2006-08-17  9:18               ` Amit Kucheria
2006-08-17 21:40                 ` Pavel Machek
2006-08-18  5:42                   ` Vitaly Wool
2006-08-23 12:28                     ` Pavel Machek
2006-08-23 15:26                       ` Igor Stoppa
2006-08-24 12:58                       ` Vitaly Wool
2006-08-25 19:55                         ` Pavel Machek
2006-08-25 23:26                           ` Vitaly Wool
2006-08-26 10:18                             ` Pavel Machek
2006-08-26 13:30                               ` Vitaly Wool
2006-08-26 13:46                                 ` Pavel Machek
2006-08-28 16:40                                   ` Mark Gross
2006-08-28 17:39                                     ` Pavel Machek
2006-08-29  7:51                                       ` Matthew Locke
2006-08-30 22:13                                       ` Mark Gross
2006-08-30 22:27                                         ` Pavel Machek
2006-08-18 11:48                   ` Amit Kucheria
2006-08-24  7:59                     ` Pavel Machek
2006-08-30 11:00                       ` Amit Kucheria
2006-08-30 22:36                         ` Pavel Machek
2006-08-31 13:44                           ` Amit Kucheria
2006-09-02 11:17                             ` Pavel Machek
2006-08-17 21:24             ` Pavel Machek
2006-08-19  6:10           ` David Singleton
2006-08-22  2:13             ` Greg KH
2006-08-22  5:20               ` David Singleton
2006-08-23 19:05             ` Mark Gross
2006-08-24 12:39             ` Pavel Machek
2006-08-19  6:19           ` David Singleton
     [not found]             ` <20060819184843.GB15644@redhat.com>
2006-08-20  3:20               ` David Singleton
2006-08-20  3:30                 ` Dave Jones
2006-08-23 18:50                   ` Mark Gross
2006-08-27  4:37                   ` David Singleton
2006-08-27 15:41                     ` Pavel Machek
2006-08-29 15:55                       ` David Singleton
2006-08-29 16:34                         ` Pavel Machek
2006-08-29 17:49                           ` Preece Scott-PREECE
2006-08-30  6:20                             ` Matthew Locke
2006-08-30 13:26                               ` Preece Scott-PREECE
2006-08-30 22:50                                 ` Pavel Machek
2006-08-31  0:22                                   ` Preece Scott-PREECE
2006-08-31 12:04                                     ` Pavel Machek
2006-09-02 18:05                               ` David Singleton
2006-09-02 19:30                                 ` Rafael J. Wysocki
2006-09-03 16:25                                   ` David Singleton
2006-09-03 20:57                                     ` Rafael J. Wysocki
2006-09-03 21:33                                     ` Pavel Machek
2006-09-09  0:39                                       ` David Singleton
2006-09-09  0:48                                         ` David Singleton
2006-09-09 16:13                                           ` Pavel Machek
2006-09-09 12:17                                         ` Pavel Machek
2006-09-11 15:11                                           ` David Singleton
2006-09-11 17:14                                             ` Pavel Machek
2006-09-11 18:58                                             ` Matthew Locke
2006-08-30  4:52                           ` David Singleton
2006-08-30  5:52                             ` Matthew Locke
2006-08-30 13:39                               ` Preece Scott-PREECE
2006-08-30 22:43                             ` Pavel Machek
2006-08-27 19:48                     ` Greg KH
2006-08-28  0:07                       ` David Singleton
2006-08-27 20:54                     ` Eugeny S. Mints
2006-08-28 22:18                       ` Pavel Machek
2006-08-29 21:46                         ` Eugeny S. Mints
2006-08-29  1:29                       ` David Singleton
2006-08-29 22:39                         ` Eugeny S. Mints
2006-08-31 13:27                         ` Amit Kucheria
2006-08-31 19:22                           ` Preece Scott-PREECE
2006-09-01  8:11                             ` Amit Kucheria
2006-08-14 23:29   ` Dominik Brodowski
2006-08-14 23:48     ` Matthew Locke

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=200609051231.59356.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-pm@lists.osdl.org \
    --cc=matthew.a.locke@comcast.net \
    --cc=pavel@ucw.cz \
    --cc=scott.preece@motorola.com \
    /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