Whether I try to hibernate by running
Code: Select all
echo disk > /sys/power/stateThe page size is 4KiB, as implied by dmesg messages such as# dmesg | fgrep -C 2 "Not enough free"
[ 115.425467] PM: hibernation: Creating image:
[ 115.605272] PM: hibernation: Need to copy 1034086 pages
[ 115.605277] PM: hibernation: Not enough free memory
[ 115.425998] PM: hibernation: Error -12 creating image
[ 115.426009] ACPI: PM: Restoring platform NVS memory
--
[12969.416937] PM: hibernation: Creating image:
[12969.603243] PM: hibernation: Need to copy 1173639 pages
[12969.603248] PM: hibernation: Not enough free memory
[12969.417467] PM: hibernation: Error -12 creating image
[12969.417477] ACPI: PM: Restoring platform NVS memory
--
[15435.266025] PM: hibernation: Creating image:
[15435.268343] PM: hibernation: Need to copy 1135535 pages
[15435.268343] PM: hibernation: Not enough free memory
[15435.268343] PM: hibernation: Error -12 creating image
[15435.268343] ACPI: PM: Restoring platform NVS memory
--
[19313.907975] PM: hibernation: Creating image:
[19313.911060] PM: hibernation: Need to copy 1035412 pages
[19313.911060] PM: hibernation: Not enough free memory
[19313.911060] PM: hibernation: Error -12 creating image
[19313.911060] ACPI: PM: Restoring platform NVS memory
--
[22946.540965] PM: hibernation: Creating image:
[22946.543076] PM: hibernation: Need to copy 1046173 pages
[22946.543076] PM: hibernation: Not enough free memory
[22946.543076] PM: hibernation: Error -12 creating image
[22946.543076] ACPI: PM: Restoring platform NVS memory
# LANG=en_US.UTF-8 free -k
total used free shared buff/cache available
Mem: 7553808 3921892 3210932 733844 1165792 3631916
Swap: 16777212 7347720 9429492
and by /proc/1/smaps.[15427.731732] PM: hibernation: Allocated 747345 pages for snapshot
[15427.731737] PM: hibernation: Allocated 2989380 kbytes in 6.70 seconds (446.17 MB/s)
The question is why doesn't the kernel find enough room for those 4 GiB of image in the swap space as the available swap is more than the double of that quantity?
I also tried hibernating after changing /sys/power/image_size to 0 from the default 2/5 of physical memory size. It worked, because the image size way smaller this time:
Mind that the memory load of the machine was not changed during the last two attempts, as much as humanly possible.[25074.727908] PM: hibernation: Creating image:
[25074.731043] PM: hibernation: Need to copy 562810 pages
