[upower] waterline for "enough swap for hibernate"

Martin Pitt martin.pitt at ubuntu.com
Wed Jul 7 00:27:40 PDT 2010

Hello Richard, hello all,

We were wondering about improving upower's check whether hibernate has
sufficient swap space. Right now it considers hibernate possible if
there is at least (active memory) * 0.8 free swap. (The 0.8 is defined

This reportedly fails sometimes. I was wondering if 0.8 has any
particular meaning or intention?

Colin King explained some details about how much swap will be required
for hibernation [1]. In short, it seems that for each MB of active
memory we need 2 KB of meta information for the pages. Linux' native
suspend-to-disk apparently does not use compression, so the 0.8 would
only make sense when using uswsusp or similar alternatives which do
support compression.

So would it make sense to bump UP_DAEMON_SWAP_WATERLINE? If we assume
no compression, it seems that 100.2f would make sense, with
compression it's hard to predict of course.



[1] https://bugs.launchpad.net/oem-priority/+bug/599352/comments/4

Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20100707/b13e0995/attachment.pgp>

More information about the devkit-devel mailing list