linux/kernel
Samuel Zhang 2640e81947 PM: hibernate: shrink shmem pages after dev_pm_ops.prepare()
When hibernate with data center dGPUs, huge number of VRAM data will be
moved to shmem during dev_pm_ops.prepare(). These shmem pages take a lot
of system memory so that there's no enough free memory for creating the
hibernation image. This will cause hibernation fail and abort.

After dev_pm_ops.prepare(), call shrink_all_memory() to force move shmem
pages to swap disk and reclaim the pages, so that there's enough system
memory for hibernation image and less pages needed to copy to the image.

This patch can only flush and free about half shmem pages. It will be
better to flush and free more pages, even all of shmem pages, so that
there're less pages to be copied to the hibernation image and the overall
hibernation time can be reduced.

Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20250710062313.3226149-4-guoqing.zhang@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
2025-07-10 10:49:45 -05:00
..
bpf - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
cgroup cgroup: A fix for v6.16-rc1 2025-06-03 14:12:36 -07:00
configs Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
debug
dma dma-mapping updates for Linux 6.16: 2025-05-27 20:09:06 -07:00
entry
events - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
futex - The 2 patch series "zram: support algorithm-specific parameters" from 2025-06-02 16:00:26 -07:00
gcov
irq
kcsan
livepatch
locking Generic: 2025-06-02 12:24:58 -07:00
module Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
power PM: hibernate: shrink shmem pages after dev_pm_ops.prepare() 2025-07-10 10:49:45 -05:00
printk
rcu treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
sched treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
time posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() 2025-06-13 10:55:49 -07:00
trace tracing: Do not free "head" on error path of filter_free_subsystem_filters() 2025-06-10 09:39:58 -04:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.kexec - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
Kconfig.locks
Kconfig.preempt
Makefile - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cfi.c
compat.c
configs.c
context_tracking.c
cpu.c
cpu_pm.c
crash_core.c
crash_dump_dm_crypt.c
crash_reserve.c
cred.c
delayacct.c delayacct: remove redundant code and adjust indentation 2025-05-27 19:40:33 -07:00
dma.c
elfcorehdr.c
exec_domain.c
exit.c - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
exit.h
extable.c
fail_function.c
fork.c - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
freezer.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kallsyms_internal.h
kallsyms_selftest.c
kallsyms_selftest.h
kcmp.c
kcov.c
kexec.c
kexec_core.c
kexec_elf.c
kexec_file.c - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
kexec_handover.c
kexec_internal.h
kheaders.c
kprobes.c
ksyms_common.c
ksysfs.c
kthread.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
latencytop.c
module_signature.c
notifier.c
nsproxy.c
padata.c
panic.c - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
params.c
pid.c
pid_namespace.c
pid_sysctl.h
profile.c
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource.c
resource_kunit.c
rseq.c
scftorture.c
scs.c
seccomp.c
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c
stackleak.c
stacktrace.c
static_call.c
static_call_inline.c
stop_machine.c
sys.c
sys_ni.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
usermode_driver.c
utsname.c
utsname_sysctl.c
vhost_task.c
vmcore_info.c
watch_queue.c
watchdog.c
watchdog_buddy.c
watchdog_perf.c
workqueue.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
workqueue_internal.h