[sugar] "fake hibernate" (was problem in sugar_jhbuild)

Tomeu Vizoso tomeu at tomeuvizoso.net
Thu Feb 28 14:00:11 EST 2008


On Thu, Feb 28, 2008 at 7:15 PM, Morgan Collett
<morgan.collett at collabora.co.uk> wrote:
> 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
>  > implementations.
>
>  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?

There already exist facilities around X for apps to save their state
and for session managers to restore the desktop as it was before.

Our model of activities and journal make this much more workable that
in the regular X desktop.

Having the shell to write some .desktop files each with the saved
journal entry id would allow us to restore a state quite similar to
which the user had before hibernating.

http://www.xfree86.org/current/xsmp.pdf

Tomeu


More information about the Sugar mailing list