On Thu, Apr 21, 2016 at 12:00:55PM -0600, Chris Murphy wrote: > On Wed, Apr 20, 2016 at 3:14 AM, Lennart Poettering > <lenn...@poettering.net> wrote: > > On Tue, 19.04.16 22:47, Chris Murphy (li...@colorremedies.com) wrote: > > > >> In some ancient bug or lkml I'd read a kernel maintainer say that the > >> hibernation image size isn't fixed, and might be less than RAM size > >> but could be a little more than RAM size, especially if some swap is > >> being used. So what should swap partition size be to support > >> hibernation? 1x RAM? 1.5x? 2x? Other? > > > > Here's the heuristics code logind uses to check whether hibernation > > shall be considered available or not: > > > > https://github.com/systemd/systemd/blob/master/src/shared/sleep-config.c#L229 > > > > i.e. it checks that the RAM size is smaller than 0.98 times the > > currently unused swap space. > > Default Fedora 24 installation, 'free' shows > > Mem: 2048524 > Swap: 2098172
Just to clear up a misconception: The check in enough_memory_for_hibernation() uses Active(anon), not the total RAM size. The line shown by free as "Mem" includes buffers which are not included in Active(anon). The relevant field is in the "+/- buffers" line. This is improved in the version of free in F24, which does away with the "+/-" buffers line, and the "Mem used" value is more meaningful. > Mem is 0.976 times unused swap, on a clean boot where no swap at all > is being used. If as little as 8MiB swap were used, sounds like > hibernation would fail? No, in the normal case it wouldn't. Zbyszek _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel