Unexpected memory allocation failure in hibernation snapshot (swsusp)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
In kernel 4.4.0-97, the system snapshot can fail during suspend-to-disk or -to-both even though the routine swsusp_save() believes that there is enough memory for the snapshot.
What I expected to happen
=======
After 'systemctl hibernate' or 'systemctl hybrid-sleep', the requested suspend state is reached, or a diagnostic is provided.
What happened instead
=======
After 'systemctl hibernate' or 'systemctl hybrid-sleep', system returns to normal desktop with no visible diagnostic after 'systemctl hibernate' or 'systemctl hybrid sleep'.
System log/journal shows diagnostics and backtrace, as attached:
...
Oct 17 10:51:45 Spiridion kernel: PM: Creating hibernation image:
Oct 17 10:51:45 Spiridion kernel: PM: Need to copy 174616 pages
Oct 17 10:51:45 Spiridion kernel: PM: Normal pages needed: 112567 + 1024, available pages: 115651
Oct 17 10:51:45 Spiridion kernel: s2both: page allocation failure: order:0, mode:0x2080120
...
Oct 17 10:51:45 Spiridion kernel: [<c13ae82f>] dump_stack+
Oct 17 10:51:45 Spiridion kernel: [<c11783e6>] warn_alloc_
Oct 17 10:51:45 Spiridion kernel: [<c117a994>] __alloc_
Oct 17 10:51:45 Spiridion kernel: [<c117ae66>] ? __alloc_
Oct 17 10:51:45 Spiridion kernel: [<c117ae66>] __alloc_
Oct 17 10:51:45 Spiridion kernel: [<c10c000f>] alloc_image_
Oct 17 10:51:45 Spiridion kernel: [<c10c1678>] swsusp_
...
And the concluding entries after the memory debugging output:
Oct 17 10:51:45 Spiridion kernel: PM: Memory allocation failed
Oct 17 10:51:45 Spiridion kernel: PM: Error -12 creating hibernation image
At this point the swsusp_save() function has successfully checked for free memory
enough_
and then called
swsusp_
So either enough_free_mem() is not sufficiently accurate or conservative, or swsusp_alloc() is not sufficiently aggressive in using the available memory.
This code seems to be the same at least down to the call to alloc_image_page() in later versions, eg 4.13.7.
The functions 'systemctl hibernate', 'systemctl hybrid-sleep' have been seen to work as expected in the identical configuration when the system memory is more lightly loaded (eg "PM: Need to copy 103159 pages").
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-generic 4.4.0.97.102
ProcVersionSign
Uname: Linux 4.4.0-97-generic i686
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: i386
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CurrentDesktop: LXDE
Date: Tue Oct 17 14:52:34 2017
HibernationDevice: #RESUME=
InstallationDate: Installed on 2017-02-12 (247 days ago)
InstallationMedia: LXLE 16.04 - Release i386
MachineType: Dell Inc. Inspiron 1520
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
linux-
linux-
linux-firmware 1.157.12
RfKill:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 07/11/2008
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A09
dmi.board.name: 0KY767
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.
dmi.product.name: Inspiron 1520
dmi.sys.vendor: Dell Inc.
This change was made by a bot.