mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: david@lang.hm
Cc: Alan Stern <stern@rowland.harvard.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Huang, Ying" <ying.huang@intel.com>,
	Jeremy Maitin-Shepard <jbms@cmu.edu>,
	Kyle Moffett <mrmacman_g4@mac.com>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Pavel Machek <pavel@ucw.cz>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Al Boldi <a1426z@gawab.com>
Subject: Re: Hibernation considerations
Date: Tue, 17 Jul 2007 22:57:21 +0200	[thread overview]
Message-ID: <200707172257.22959.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.64.0707171302430.2467@asgard.lang.hm>

On Tuesday, 17 July 2007 22:18, david@lang.hm wrote:
> On Tue, 17 Jul 2007, Rafael J. Wysocki wrote:
> 
> > On Tuesday, 17 July 2007 19:06, david@lang.hm wrote:
> >> On Tue, 17 Jul 2007, Rafael J. Wysocki wrote:
> >>
> >>> On Tuesday, 17 July 2007 17:29, david@lang.hm wrote:
> >>>> On Tue, 17 Jul 2007, Rafael J. Wysocki wrote:
> >>>>
> >>>>> On Tuesday, 17 July 2007 16:15, Alan Stern wrote:
> >>>>>> On Mon, 16 Jul 2007 david@lang.hm wrote:
> >>>>>>
> >>>>>>>> I agree, it would be good to have a non-ACPI-specific hibernation mode,
> >>>>>>>> something which would look to ACPI like a normal shutdown.  But I'm not
> >>>>>>>> so sure this is possible.
> >>>>>>>
> >>>>>>> why would it not be possible?
> >>>>>>
> >>>>>>> I can't think of anything much more frustrating then thinking that I
> >>>>>>> suspended a system and then discovering that becouse the battery went dead
> >>>>>>> (a complete power loss) that the system wouldn't boot up properly. to me
> >>>>>>> this would be a fairly common condition (when I'm mobile I use the machine
> >>>>>>> until I am out of battery, then stop and it may be a long time (days)
> >>>>>>> before I can charge the thing up again) this would not be a reliable
> >>>>>>> suspend as far as I'm concerned.
> >>>>>>>
> >>>>>>> for suspend-to-ram you have to worry about ACPI states and what you are
> >>>>>>> doing with them, for suspend-to-disk you can ignore them and completely
> >>>>>>> power the system off instead.
> >>>>>>
> >>>>>> If the only problem with doing this would be lack of wakeup support
> >>>>>> then I'm all for it.  There must be a lot of people who would like
> >>>>>> their computers to hibernate with power drain as close to 0 as possible
> >>>>>> and who don't care about remote wakeup.  In fact they might even prefer
> >>>>>> not to have wakeup support, so the computer doesn't resume at
> >>>>>> unexpected times.
> >>>>>
> >>>>> I'm afraid of one thing, though.
> >>>>>
> >>>>> If we create a framework without ACPI (well, ACPI needs to be enabled in the
> >>>>> kernel anyway for other reasons, like the ability to suspend to RAM) and then
> >>>>> it turns out that we have to add some ACPI hooks to it, that might be difficult
> >>>>> to do cleanly.
> >>>>
> >>>> doing suspend-to-ram should be orthoginal to doing hibernate-to-disk. some
> >>>> people will want both, some won't.
> >>>>
> >>>> at the moment kexec doesn't work with ACPI, that is a limitation that
> >>>> should be fixed, but makeing it able to work with ACPI enabled doesn't
> >>>> mean that it needs to be changed to depend on ACPI and it especially
> >>>> doesn't mean that it should pick up the limitations of the existing ACPI
> >>>> based hibernation approaches.
> >>>>
> >>>> if there is no ACPI on the system it should work, if ther is ACPI on the
> >>>> system it should still work.
> >>>>
> >>>>> Thus, it seems reasonable to think of the ACPI handling in advance.
> >>>>
> >>>> but don't become dependant on ACPI.
> >>>
> >>> Not dependent, but with the possibility of ACPI support taken into account.
> >>>
> >>> Arguably you can create a framework that, for example, will not allow the user
> >>> to adjust the size of the image, but then adding such a functionality may
> >>> require you to change the entire design.  Same thing with ACPI.
> >>>
> >>> I would rather avoid such pitfalls, if I could.
> >>
> >> Ok, what is it that you think ACPI fundamentally changes in this process?
> >>
> >> keep in mind that we are not makeing the assumption that the hardware
> >> will remain powered (even a little bit), or the assumption that nothing
> >> else will run on the hardware (eliminating any possibility that the
> >> hardware is in a known ACPI state)
> >
> > Well, first, the fact is that _some_ systems _will_ be powered while in
> > hibernation (the majority of notebooks, for example) and you should assume
> > that the platform _may_ retain some information accross the hibernation/restore
> > cycle.  In that case you _should_ _not_ trash the information retained by the
> > platform.
> 
> no, systems that remain powered while asleep are a different type of 
> suspend then ones that don't.
> 
> > Now, with that in mind, ACPI requires us to make the system enter the S4 sleep
> > state as a result of the hibernation procedure.  In my opinion this may be done
> > after saving the image, but still this means, for example, that the
> > image-saving kernel needs to support ACPI.
> >
> > Next, during the restore, we should first check if the image is present (and
> > valid) _without_ turning ACPI on (note that this is not done by the current
> > hibernation code and that leads to strange problems on some systems).  Then,
> > if the image is present (and valid), we should first load it, jump to the
> > hibernated kernel and _then_ turn ACPI on and execute the _BFS and
> > _WAK ACPI global methods (again, this is not done by the current code in that
> > order, which is wrong).  Only after that is the hibernated kernel supposed to
> > continue.
> >
> > [Please refer to section 15.3 of the 3.0b ACPI spec for details.]
> 
> you are starting from the assumption that ACPI S4 mode should be used.
> 
> I'm saying that a suspend that uses ACPI S4 mode is fundamentally 
> different from one that does a power off instead.

It is different, but not fundamentally.

> from my point of view the ACPI S4 sleep mode has far more in common with 
> suspend-to-ram then with the suspend-to-disk that I'm talking about
> 
> non-ACPI hibernate
> 
>    since the box powers off
>      it uses zero power while suspended
>      another OS could be run before a resume
>      hardware can be swapped, suspend image could be sent around the world to be restored on another system.
>      restore makes no assumptions about the state of the hardware when it is restored
>      restore is slower (full BIOS boot is required)
>    should be able to work on just about any hardware (the limit is the ability to initialize the devices)
> 
> 
> ACPI suspends
> 
>    since the box never completely powers off:
>      a complete power failure breaks the suspend
>      the OS must remain in control so other uses must be prevented.
>      hardware must remain in the ACPI state from suspend until restore.
>      restore can be faster (some initialization may be able to be skipped)
>    requires ACPI hardware support
> 
> under the catagory of ACPI suspends you have
> 
>    fast suspend-to-ram (stop scheduling, put the CPU to sleep, as long as 
> the memory keeps getting refreshed)
>    slow suspend-to-ram (stop scheduling, put as much of the hardware as 
> possible to sleep, including spinning down disks and other things that 
> take a while to undo)
>    suspend-to-disk (stop scheduleing, copy the ram somewhere so that it 
> doesn't need to be refreshed, put everything into low-power mode)
> 
>    and there are probably quite a few others as well. but they are all in 
> the same family in that you have to worry about ACPI states, and they all 
> have the same restrictions on what can happen between suspend and resume
> 
> the non-ACPI hibernate behaves very differently, and for some people (and 
> I think I am one of them) it will meet their needs better then _any_ of 
> the ACPI suspends.

OTOH, there are many people who would want the ACPI suspends to be handled
and they don't really care for the power-off-only hibernation.

If you aren't going to support the ACPI hibernation, your framework will be
incomplete and therefore not generally useful.

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

  parent reply	other threads:[~2007-07-17 20:52 UTC|newest]

Thread overview: 220+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15 12:33 Rafael J. Wysocki
2007-07-15 12:51 ` Nigel Cunningham
2007-07-15 12:58 ` Dr. David Alan Gilbert
2007-07-15 22:38   ` Rafael J. Wysocki
2007-07-15 22:27     ` david
2007-07-17 17:40       ` Dr. David Alan Gilbert
2007-07-17 17:49         ` david
2007-07-29  6:53     ` Vojtech Pavlik
2007-07-29  9:56       ` Rafael J. Wysocki
2007-08-05 19:56       ` encrypted hibernation (was Re: Hibernation considerations) Pavel Machek
2007-08-11 23:43         ` Dr. David Alan Gilbert
2007-08-12 22:12           ` Rafael J. Wysocki
2007-08-18 19:37             ` Dr. David Alan Gilbert
2007-08-21  7:29               ` Pavel Machek
2007-08-13  2:30           ` Michael Chang
2007-08-13  4:53             ` alon.barlev
2007-07-15 15:10 ` Hibernation considerations Al Boldi
2007-07-15 15:35   ` jimmy bahuleyan
2007-07-15 17:40     ` Al Boldi
2007-07-15 16:29   ` Alan Stern
2007-07-15 17:40     ` Al Boldi
2007-07-15 23:28       ` Alan Stern
2007-07-15 23:58         ` david
2007-07-16  5:02         ` Al Boldi
2007-07-16  6:49           ` david
2007-07-16 13:32             ` Al Boldi
2007-07-17  4:33               ` david
2007-07-17 12:08                 ` Al Boldi
2007-07-17 14:18                   ` Rafael J. Wysocki
2007-07-17 15:23                   ` david
2007-07-16 14:53           ` Alan Stern
2007-07-16 16:51             ` Al Boldi
2007-07-17  4:37               ` david
2007-07-15 19:52     ` david
2007-07-15 20:13 ` david
2007-07-15 22:47   ` Rafael J. Wysocki
2007-07-15 22:42     ` david
2007-07-15 23:15       ` Alan Stern
2007-07-15 23:38         ` Nigel Cunningham
2007-07-16 14:15           ` Alan Stern
2007-07-16 15:25             ` Rafael J. Wysocki
2007-07-15 23:41         ` david
2007-07-16 14:21           ` Alan Stern
2007-07-17  4:45             ` david
2007-07-17 14:15               ` Alan Stern
2007-07-17 14:40                 ` Rafael J. Wysocki
2007-07-17 15:29                   ` david
2007-07-17 16:02                     ` Rafael J. Wysocki
2007-07-17 17:06                       ` david
2007-07-17 19:50                         ` Rafael J. Wysocki
2007-07-17 20:18                           ` david
2007-07-17 20:39                             ` Jeremy Maitin-Shepard
2007-07-17 20:39                               ` david
2007-07-17 20:58                               ` Rafael J. Wysocki
2007-07-17 20:57                             ` Rafael J. Wysocki [this message]
2007-07-17 20:53                               ` david
2007-07-17 21:37                                 ` Rafael J. Wysocki
2007-07-17 21:42                                   ` david
2007-07-17 21:53                                     ` Jeremy Maitin-Shepard
2007-07-21 10:25                             ` Pavel Machek
2007-07-21 15:35                               ` Jeremy Maitin-Shepard
2007-07-21 17:56                                 ` Pavel Machek
2007-07-21 19:35                                   ` david
2007-07-21 19:49                                     ` Pavel Machek
2007-07-21 22:14                                       ` david
2007-08-01 16:58                             ` Stefan Seyfried
2007-07-17 20:24                           ` Jeremy Maitin-Shepard
2007-07-17 20:44                             ` david
2007-07-17 21:00                             ` Rafael J. Wysocki
2007-07-17 16:09                   ` Jeremy Maitin-Shepard
2007-07-17 19:54                     ` Rafael J. Wysocki
2007-07-17 18:32                   ` Alan Stern
2007-07-17 20:17                     ` Rafael J. Wysocki
2007-07-17 20:34                       ` david
2007-07-17 20:54                         ` Jeremy Maitin-Shepard
2007-07-17 21:04                           ` david
2007-07-17 21:23                         ` Rafael J. Wysocki
2007-07-17 21:17                           ` david
2007-07-17 21:27                             ` Jeremy Maitin-Shepard
2007-07-17 21:27                               ` david
2007-07-17 21:54                                 ` Rafael J. Wysocki
2007-07-17 21:45                               ` Rafael J. Wysocki
2007-07-17 21:43                             ` Rafael J. Wysocki
2007-07-17 20:34                       ` Jeremy Maitin-Shepard
2007-07-17 20:37                         ` david
2007-07-17 20:56                           ` Jeremy Maitin-Shepard
2007-07-17 21:06                             ` david
2007-07-17 21:40                               ` Rafael J. Wysocki
2007-07-17 21:24                           ` Rafael J. Wysocki
2007-07-17 21:11                         ` Rafael J. Wysocki
2007-07-17 20:27                     ` david
2007-07-17 21:20                       ` Rafael J. Wysocki
     [not found]                         ` <ea7a437ca4038d408ac544bbc3c2434a@bga.com>
2007-07-19 17:31                           ` [linux-pm] " david
2007-07-20 14:24                             ` Milton Miller
2007-07-20 15:44                               ` david
2007-07-19 20:28                           ` Rafael J. Wysocki
2007-07-19 23:07                             ` david
2007-07-20 11:17                               ` Rafael J. Wysocki
2007-07-20 15:35                                 ` david
2007-07-20 16:15                                   ` Alan Stern
2007-07-20 21:46                                     ` Rafael J. Wysocki
2007-07-20 16:56                                 ` Milton Miller
2007-07-20 17:31                                   ` Jeremy Maitin-Shepard
2007-07-20 21:30                                     ` Rafael J. Wysocki
2007-07-20 19:26                                   ` david
2007-07-20 21:28                                   ` Rafael J. Wysocki
2007-07-20 21:33                                     ` Jeremy Maitin-Shepard
2007-07-20 22:19                                       ` Rafael J. Wysocki
     [not found]                               ` <20070720152744.GH20529@grifter.jdc.home>
2007-07-20 15:36                                 ` david
2007-07-20 21:43                                   ` Rafael J. Wysocki
2007-07-20 21:39                                     ` david
2007-07-20 22:22                                       ` Rafael J. Wysocki
2007-07-20 22:39                                         ` david
2007-07-20 16:08                             ` Milton Miller
2007-07-20 16:20                               ` Alan Stern
2007-07-20 17:32                                 ` Milton Miller
2007-07-20 18:17                                   ` Alan Stern
2007-07-20 19:08                                     ` Milton Miller
2007-07-20 19:37                                       ` Alan Stern
2007-07-20 20:03                                     ` Oliver Neukum
2007-07-20 20:12                                       ` Alan Stern
2007-07-20 21:35                                         ` Oliver Neukum
2007-07-20 22:25                                           ` Alan Stern
2007-07-23 14:23                                             ` Oliver Neukum
2007-07-23 20:05                                               ` Towards eliminating the freezer Alan Stern
2007-07-24  8:21                                                 ` Oliver Neukum
2007-07-24 14:27                                                   ` Alan Stern
2007-07-24  9:33                                                 ` Rafael J. Wysocki
2007-07-24 14:29                                                   ` Alan Stern
2007-07-24 15:24                                                     ` Rafael J. Wysocki
2007-07-24 16:06                                                       ` Alan Stern
2007-07-24 19:20                                                         ` Rafael J. Wysocki
2007-07-24 20:24                                                           ` Alan Stern
2007-07-24 21:14                                                             ` Rafael J. Wysocki
2007-07-24 22:14                                                               ` Alan Stern
2007-07-25 12:23                                                                 ` Rafael J. Wysocki
2007-08-01  9:34                                             ` [linux-pm] Re: Hibernation considerations Pavel Machek
2007-08-03  3:50                                               ` david
2007-07-20 20:31                                 ` david
2007-07-20 21:24                                   ` Alan Stern
2007-07-20 21:34                                     ` david
2007-07-20 22:15                                       ` Rafael J. Wysocki
2007-07-20 21:37                                     ` Jeremy Maitin-Shepard
2007-07-20 22:35                                       ` Alan Stern
2007-07-20 22:43                                         ` david
2007-07-21  5:21                                           ` Nigel Cunningham
2007-07-21 14:10                                           ` Alan Stern
2007-07-22  3:43                                             ` david
2007-07-22 16:00                                               ` Alan Stern
2007-07-22 21:50                                                 ` david
2007-07-23 15:19                                                   ` Alan Stern
2007-07-23 19:01                                                     ` david
2007-07-23 20:22                                                       ` Alan Stern
2007-07-24 13:26                                                         ` Huang, Ying
2007-07-24 14:50                                                           ` Alan Stern
2007-07-20 22:48                                         ` Jeremy Maitin-Shepard
2007-07-20 21:02                               ` Rafael J. Wysocki
2007-07-21 11:44                                 ` Miklos Szeredi
2007-07-21 12:43                                   ` Nigel Cunningham
2007-07-21 13:56                                     ` Alan Stern
2007-07-21 16:13                                     ` Jeremy Maitin-Shepard
2007-07-21 18:12                                       ` Miklos Szeredi
2007-07-21 19:20                                         ` Rafael J. Wysocki
2007-08-01  9:22                                           ` Pavel Machek
2007-08-02 17:02                                             ` Rafael J. Wysocki
2007-07-21 22:21                                         ` Nigel Cunningham
2007-07-21 22:16                                       ` Nigel Cunningham
2007-07-22 15:26                                         ` Alan Stern
2007-07-22 16:27                                           ` Miklos Szeredi
2007-07-22 20:09                                             ` Alan Stern
2007-07-22 21:54                                               ` david
2007-07-22 22:42                                           ` Nigel Cunningham
2007-07-22 23:09                                             ` Rafael J. Wysocki
2007-07-22 23:18                                               ` Nigel Cunningham
2007-07-23  0:04                                             ` Paul Mackerras
2007-07-23  3:11                                               ` Nigel Cunningham
2007-07-23 15:23                                                 ` Alan Stern
2007-07-23 21:55                                                   ` Nigel Cunningham
2007-07-23 22:10                                                     ` Rafael J. Wysocki
2007-07-23  5:31                                             ` david
2007-07-23 10:24                                             ` Miklos Szeredi
2007-07-23 12:08                                               ` Rafael J. Wysocki
2007-07-23 12:14                                                 ` Miklos Szeredi
2007-07-23 12:27                                                   ` Rafael J. Wysocki
2007-07-23 12:31                                                   ` Oliver Neukum
2007-07-23 13:08                                                     ` Miklos Szeredi
2007-07-23 14:01                                                       ` Rafael J. Wysocki
2007-07-23 14:01                                                         ` Miklos Szeredi
2007-07-23 19:08                                                     ` david
2007-08-01  9:19                                     ` Pavel Machek
     [not found]                         ` <40fa2626aff7b6b590ad6aa4737fc873@bga.com>
2007-07-20 14:48                           ` Huang, Ying
2007-07-20 15:48                             ` david
2007-07-22  2:17                               ` Huang, Ying
2007-07-22  2:32                                 ` david
2007-07-20 21:34                             ` Rafael J. Wysocki
2007-07-17 22:38                       ` Alan Stern
2007-07-17 22:37                         ` david
2007-07-18 14:29                           ` Alan Stern
2007-07-18 14:47                             ` Rafael J. Wysocki
2007-07-20  4:40                               ` Al Boldi
2007-07-20 10:59                                 ` Rafael J. Wysocki
2007-07-21 10:17               ` Pavel Machek
2007-07-15 23:22       ` Rafael J. Wysocki
2007-07-15 23:49         ` david
2007-07-16 12:06           ` Rafael J. Wysocki
     [not found]             ` <20070716123849.GC14212@grifter.jdc.home>
2007-07-16 15:29               ` Rafael J. Wysocki
2007-07-17  4:28                 ` david
2007-07-17 10:42                   ` Matthew Garrett
2007-07-17 15:19                     ` david
2007-07-18  2:18                       ` Matthew Garrett
2007-07-18  3:54                         ` david
2007-07-18 11:10                           ` Matthew Garrett
2007-07-18 12:56                             ` david
2007-07-15 23:17   ` Alan Stern
2007-07-15 23:53     ` david
2007-07-16  5:18       ` Jeremy Maitin-Shepard
2007-07-15 20:35 ` Cornelius Riemenschneider
2007-07-15 19:46   ` david
2007-07-16  0:51 ` Matthew Garrett
2007-07-16  0:51   ` david

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=200707172257.22959.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=a1426z@gawab.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@lang.hm \
    --cc=ebiederm@xmission.com \
    --cc=jbms@cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mrmacman_g4@mac.com \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=stern@rowland.harvard.edu \
    --cc=ying.huang@intel.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

all inboxes | Powered by JetHome®