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.
pm-is-supported does all the work upower was duplicating, and it handles more
use cases than the old upower code did. No point in duplicating functionality.
Signed-off-by: Richard Hughes <richard@hughsie.com>
up_daemon_check_swap_space uses the Active: line from /proc/meminfo to
determine the amount of swap the system needs to be able to suspend. However,
because Active: includes both anonymous and file-backed pages, this greatly
overestimates the amount of swap needed. File-backed pages can be written back
to disk and so do not consume swap.
Instead, up_daemon_check_swap_space should use Active(anon): from /proc/meminfo
because only anonymous pages need to be written out to swap during a suspend.
Signed-off-by: Richard Hughes <richard@hughsie.com>