public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@tuxonice.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] PM / Hibernate: Add sysfs knob to control size of memory for drivers
Date: Tue, 17 May 2011 07:34:49 +1000	[thread overview]
Message-ID: <4DD19879.5020606@tuxonice.net> (raw)
In-Reply-To: <201105151136.22169.rjw@sisk.pl>

Hi.

On 15/05/11 19:36, Rafael J. Wysocki wrote:
> In fact, if drivers allocated their memory from suspend/hibernate notifiers,
> that would be practically equivalent to setting reserved_size to the total
> amount of memory reserved by the drivers.  However, it may be difficult
> for drivers to predict how much memory they will need at the time the
> notifiers are called (they are called before freezing user space).
> 
> Thus I'm considering a change that will cause device drivers' ->prepare()
> callbacks to be executed before the preallocation of memory takes place.
> In that case the drivers may allocate memory from their ->prepare()
> callbacks _after_ user space has been frozen and that will make more
> sense overall.
> 
> For now, however, I think that exposing reserved_size is the right choice.

Sorry for not commenting earlier - too busy with Drupal development and
only came across this thread by chance (yes, I'm still subscribed to the
PM list, but haven't been reading it. Hibernation isn't high on my list
of priorities at the moment because TOI is feature complete and stable.
I know I'm supposed to be sending you patches, but other things have
been taking the time that would be used for that).

Anyway...

This sounds to me like a great development. As far as TuxOnIce goes,
we've had a knob for ages that has allowed the user to specify an amount
of memory to be kept aside for driver allocations, and we calculate and
report how much they used in the debugging info sysfs entry. Because
TuxOnIce works differently to [u]swsusp, this is the only source of
potential out-of-memory related failures, and the measures just
mentioned made things much more reliable.

If things went in the direction you're suggesting here, they'd get
better again. I'm all in favour!

Regards,

Nigel

  parent reply	other threads:[~2011-05-16 21:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201105100059.25372.rjw@sisk.pl>
2011-05-14 22:56 ` [RFC][PATCH] PM / Hibernate: Add sysfs knob to control size of memory for drivers Rafael J. Wysocki
     [not found] ` <201105150056.55601.rjw@sisk.pl>
2011-05-15  8:51   ` Martin Steigerwald
2011-05-15  9:36     ` Rafael J. Wysocki
     [not found]     ` <201105151136.22169.rjw@sisk.pl>
2011-05-15  9:51       ` Rafael J. Wysocki
2011-05-16 21:34       ` Nigel Cunningham [this message]
2011-05-16 23:22         ` Rafael J. Wysocki
2011-05-18 17:27   ` Pavel Machek
     [not found]   ` <20110518172717.GA5734@elf.ucw.cz>
2011-05-18 18:09     ` Martin Steigerwald
     [not found]     ` <201105182009.55813.Martin@lichtvoll.de>
2011-05-18 18:36       ` Pavel Machek
     [not found]       ` <20110518183638.GA8887@elf.ucw.cz>
2011-05-18 20:23         ` Rafael J. Wysocki
2011-05-09 22:59 Rafael J. Wysocki

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=4DD19879.5020606@tuxonice.net \
    --to=nigel@tuxonice.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /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