[sugar] "fake hibernate" (was problem in sugar_jhbuild)
Thu Feb 28 13:15:49 EST 2008
Benjamin M. Schwartz wrote:
> I have a proposal that might be relevant, based on a discussion with
> Chris Ball about "hibernation" (i.e. suspend-to-disk).
> Hibernation essentially saves all of userspace RAM into a file on disk,
> along with the list of active processes, then shuts down. On the next
> boot, it simply reads that file back into memory and continues those
> processes. This is a very desirable behavior, as it allows one to pause
> one's work and consume precisely zero power. However, hibernation can
> require a large amount of disk space, and is relatively fragile in
> relation to network connections and hardware state.
> I would like to propose a form of fake hibernation, implemented at the
> level of Sugar. If the user clicks the "hibernate" button, Sugar should
> tell all open activities to Keep their state, and also save: the list of
> open activities, which one was active, any clipboard objects, and which
> view was in the foreground. On the next boot, Sugar can simply restart
> all open activities from that latest checkpoint, "activate" the active
> activity, show the correct view, and recreate the clipboard. This
> approach would be far more efficient than hibernation, and IMHO more
> reliable as well.
> Fake hibernation relies on a standard reboot sequences, so boot-time
> optimization would be very valuable.
> Open questions:
> 0. Should "fake hibernate" be a user-visible option?
> 1. Should "fake hibernate" be the default shutdown behavior?
> Pro: makes system use feel very continuous.
> Con: requires manual shutdown of every activity. Potentially
> problematic interaction with memory pressure and OOM under current
Shutdown should at least tell all open activities to Keep. That's #6014
(a famous data loss bug: http://www.news.com/8301-10784_3-9859801-7.html)
> 2. Should OHM automatically trigger a "fake hibernate" under certain
> conditions, such as very low battery, or screen closed for 30 minutes
> and no mesh contacts made?
More information about the Sugar-devel