Skip to content

Commit 9401193

Browse files
committed
PM: hibernate: Restrict GFP mask in hibernation_snapshot()
JIRA: https://issues.redhat.com/browse/RHEL-109250 commit 449c9c0 Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Date: Wed Sep 10 11:41:59 2025 +0200 Commit 12ffc3b ("PM: Restrict swap use to later in the suspend sequence") incorrectly removed a pm_restrict_gfp_mask() call from hibernation_snapshot(), so memory allocations involving swap are not prevented from being carried out in this code path any more which may lead to serious breakage. The symptoms of such breakage have become visible after adding a shrink_shmem_memory() call to hibernation_snapshot() in commit 2640e81 ("PM: hibernate: shrink shmem pages after dev_pm_ops.prepare()") which caused this problem to be much more likely to manifest itself. However, since commit 2640e81 was initially present in the DRM tree that did not include commit 12ffc3b, the symptoms of this issue were not visible until merge commit 260f6f4 ("Merge tag 'drm-next-2025-07-30' of https://gitlab.freedesktop.org/drm/kernel") that exposed it through an entirely reasonable merge conflict resolution. Fixes: 12ffc3b ("PM: Restrict swap use to later in the suspend sequence") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220555 Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com> Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com> Cc: 6.16+ <stable@vger.kernel.org> # 6.16+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 594ac03 commit 9401193

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/power/hibernate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ int hibernation_snapshot(int platform_mode)
417417
}
418418

419419
console_suspend_all();
420+
pm_restrict_gfp_mask();
420421

421422
error = dpm_suspend(PMSG_FREEZE);
422423

0 commit comments

Comments
 (0)