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
This commit is contained in:
Martin Pitt 2010-07-07 11:14:32 +02:00
parent 6118ac82ec
commit fc7c6e003a

View file

@ -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 */