Enable hibernation

Steve Langasek steve.langasek at ubuntu.com
Tue Jan 7 19:05:49 UTC 2014


On Mon, Jan 06, 2014 at 04:40:51PM -0500, Phillip Susi wrote:
> On 1/6/2014 3:35 PM, Steve Langasek wrote:
> > As far back as the Maverick (i.e., 10.10) release notes[1], we
> > prominently documented the fact that the hibernate option was not
> > reliable:

> > Hibernation may be unavailable with automatic partitioning. The
> > default partitioning recipe in the installer will in some cases
> > allocate a swap partition that is smaller than the physical memory
> > in the system.  This will prevent the use of hibernation
> > (suspend-to-disk) because the system image will not fit in the swap
> > partition.  If you intend to use hibernation with your system, you
> > should ensure that the swap partition's size is at least as large
> > as the system's physical RAM.  (345126) 
> > https://bugs.launchpad.net/ubuntu/+source/partman-auto/+bug/345126

> Most of the time you don't actually need swap >= physical ram.  If you
> only have 1 GB of ram in use at the time you try to hibernate, you
> only need 1 GB of swap, even if you have 4 GB of ram.  If you install
> uswsusp, you might even need less as it compresses the pages as it
> writes them out.

Well, I just did a test here expecting it to fail based on my prior
experience, and was pleasantly surprised to find that my laptop hibernated
successfully.  So perhaps whatever bugs I was experiencing with dm-crypt in
saucy have been resolved in trusty.

As for installing uswsusp:  uswsusp is definitely *not* supported.  If we
have a hard time supporting two suspend options, it's not reasonable to ask
the developers to support three.

> > - if a newer kernel package has been installed (which happens
> > frequently), resume from hibernation will fail.

> Now that's a good technical problem.  Probably could be simply worked
> around by having the menu disable the hibernate option after a kernel
> upgrade.

"Simple" is a nice word for code that hasn't been written yet. :)

> Of course, we do already put up the big red flag telling people they need
> to reboot, so that should be almost as good.

Not even remotely!  The result of rebooting to a different kernel after
hibernate is loss of application state and an unclean filesystem.  That
needs much better than a big red 'reboot' flag, which doesn't tell the user
anything about hibernate being dangerous.

> > - if there is insufficient memory, hibernation will fail.

> I don't think that's anywhere near serious enough to disable it.  As
> long as it doesn't fail by hanging, or failing to resume properly I
> don't see this as a problem.  Probably would be nice to get a pop up
> telling you that you to free up some ram and try again though.

Right - as noted in my other mail, one of the failure scenarios here is that
the user hibernates, closes up the laptop and stows it in the bag, not
realizing it's failed to hibernate.

> > There was also the design issue:

> > - the difference between suspend and hibernate is opaque to the
> > average user; the user should not have to guess between them.

> A lot of users understand and care about the difference.  I would go
> so far as to say *most* of Ubuntu's users, which tend to be more savvy
> than the average Windows user, understands the difference.

I don't think there's any evidence of this being true.  I think there's a
very small percentage of Ubuntu power users who understand the difference
between suspend and hibernate - using those names - well enough to take
advantage of that difference; and then there's the much larger number of
ordinary users, who should be protected from the bugs.

Ubuntu is meant to be suitable for use by the ordinary user.  It certainly
shouldn't expose users to disruptive failures in prominent menu options that
are known to be unreliable.

> Even most Windows users understand the difference since they have been
> using both under Windows for years.

I also don't believe that the existence of these options under Windows is
evidence that Windows users understand the difference.

> The ignorant group should not run rough shod over the educated users.  At
> best, this is a reason to hide the hibernate option behind either a
> modifier key, or a setting that is easily found, say in the power
> settings.

There are ways that educated users can re-enable hibernate support today
(Marc alluded to one of them in this thread).  I don't think we should
expose hibernate more broadly than it already is without corresponding
effort to improve the reliability of the option.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/technical-board/attachments/20140107/1e6ddaf6/attachment.pgp>


More information about the technical-board mailing list