mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-08 01:58:02 +02:00
Fix UP_DAEMON_WATERLINE harder
Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active
memory)/(available swap), not the other way around. So replace it with 99%
instead.
Also update the documentation of up_backend_get_used_swap() to explain what the
returned percentage actually means.
This commit is contained in:
parent
04eefe984c
commit
c4a1c15d0c
2 changed files with 5 additions and 4 deletions
|
|
@ -480,7 +480,8 @@ out:
|
|||
/**
|
||||
* up_backend_get_used_swap:
|
||||
*
|
||||
* Return value: a percentage value
|
||||
* Return value: a percentage value how much of the available swap memory would
|
||||
* be taken by currently active memory
|
||||
**/
|
||||
gfloat
|
||||
up_backend_get_used_swap (UpBackend *backend)
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ G_DEFINE_TYPE (UpDaemon, up_daemon, G_TYPE_OBJECT)
|
|||
|
||||
/* if using more memory compared to usable swap, disable hibernate */
|
||||
/* 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 /* % */
|
||||
* page meta information for each MB of active memory. Add some error margin
|
||||
* here, though. */
|
||||
#define UP_DAEMON_SWAP_WATERLINE 98f /* % */
|
||||
|
||||
/* refresh all the devices after this much time when on-battery has changed */
|
||||
#define UP_DAEMON_ON_BATTERY_REFRESH_DEVICES_DELAY 1 /* seconds */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue