public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>
Subject: Re: [RFC][PATCH -mm 2/2] PM: Introduce suspend notifiers
Date: Sun, 22 Apr 2007 18:14:46 +0200	[thread overview]
Message-ID: <200704221814.46824.rjw@sisk.pl> (raw)
In-Reply-To: <20070422130034.GB4236@ucw.cz>

Hi,

On Sunday, 22 April 2007 15:00, Pavel Machek wrote:
> Hi!
> 
> 
> > Index: linux-2.6.21-rc6-mm1/Documentation/power/suspend-notifiers.txt
> > ===================================================================
> > --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> > +++ linux-2.6.21-rc6-mm1/Documentation/power/suspend-notifiers.txt	2007-04-21 23:24:50.000000000 +0200
> > @@ -0,0 +1,41 @@
> > +Suspend notifiers
> > +	(C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
> > +
> > +There are some operations that device drivers may want to carry out in their
> > +.suspend() routines, but shouldn't, because they can cause a suspend to fail.
> > +For example, a driver may want to allocate a substantial amount of memory
> > +(like 50 MB) in .suspend(), but that shouldn't be done after the swsusp's memory
> > +shrinker has run.  Also, there may be some operations, that subsystems may want
> > +to carry out before a suspend or after a resume, requiring the system to be
> > +fully functional, so the drivers' .suspend() and .resume() routines are not
> > +suitable for this purpose.
> > +
> > +The subsystems that have such needs can register suspend notifiers that will be
> > +notified of the following events by the suspend core:
> > +
> > +SUSPEND_PREPARE		the system is going to suspend, tasks will be frozen
> > +			immediately
> > +
> > +SUSPEND_ENTER_PREPARE	tasks have been frozen, memory is going to be freed
> > +			and devices are going to be suspended
> > +
> > +SUSPEND_THAW_PREPARE	devices have been resumed, tasks will be thawed
> > +			immediately
> > +
> > +SUSPEND_FINISHED	the resume is complete, the system is fully functional
> 
> + This hook is called even if suspend fails, so that we do not
> + leak memory.
> 
> 
> ?

Yes, I'll add something like this.

      reply	other threads:[~2007-04-22 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-21 22:02 [RFC][PATCH -mm 0/2] Suspend notifiers Rafael J. Wysocki
2007-04-21 22:05 ` [RFC][PATCH -mm 1/2] swsusp: Free more memory Rafael J. Wysocki
2007-04-21 23:31   ` Nigel Cunningham
2007-04-22  9:37     ` Rafael J. Wysocki
2007-04-22 22:22       ` Nigel Cunningham
2007-04-23 19:59         ` Rafael J. Wysocki
2007-04-22 12:55   ` Pavel Machek
2007-04-21 22:07 ` [RFC][PATCH -mm 2/2] PM: Introduce suspend notifiers Rafael J. Wysocki
2007-04-22 13:00   ` Pavel Machek
2007-04-22 16:14     ` Rafael J. Wysocki [this message]

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=200704221814.46824.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    /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