diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2010-07-07 11:14:32 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2010-07-07 11:14:32 +0200 |
commit | fc7c6e003a626367558300ce8566e346758ad8e7 (patch) | |
tree | 932c124fab3432c1dc7e7a767a4b495c6c1489bf | |
parent | 6118ac82ec623970dec712c9257bdc4fbfe450d5 (diff) |
Increase UP_DAEMON_SWAP_WATERLINE
Native Linux suspend-to-disk does not use compression, and needs 2 KB of page
meta information for each MB of active memory. So bump the previous waterline
of 80% of active memory to 100.2%. Add an extra .05% to prevent rounding errors.
This should make the prediction whether hibernate is going to work very
accurate. However, it might prevent hibernate for folks who use an alternative
userspace solution like uswsusp which do support compression.
http://lists.freedesktop.org/archives/devkit-devel/2010-July/000867.html
-rw-r--r-- | src/up-daemon.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c index f411146..c6cf755 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -104,7 +104,10 @@ G_DEFINE_TYPE (UpDaemon, up_daemon, G_TYPE_OBJECT) #define UP_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DAEMON, UpDaemonPrivate)) /* if using more memory compared to usable swap, disable hibernate */ -#define UP_DAEMON_SWAP_WATERLINE 80.0f /* % */ +/* Native Linux suspend-to-disk does not use compression, and needs 2 KB of + * page meta information for each MB of active memory. Add an extra .05% to + * prevent rounding errors. */ +#define UP_DAEMON_SWAP_WATERLINE 100.25f /* % */ /* refresh all the devices after this much time when on-battery has changed */ #define UP_DAEMON_ON_BATTERY_REFRESH_DEVICES_DELAY 1 /* seconds */ |