Re: [PATCH] PM: hibernate: call preallocate_image after freeze prepare

From: YoungJun Park

Date: Mon Mar 23 2026 - 11:44:34 EST


On Sat, Mar 21, 2026 at 08:51:31AM +0000, Matthew Leach wrote:

Hi Matthew,

> + /* Preallocate image memory before shutting down devices. */
> + error = hibernate_preallocate_memory();

The shrink_shmem_memory() below is also intended to run after
dpm_prepare(), and the motivation is the same. Since
hibernate_preallocate_memory() already does shrinking internally,
how about pulling out the shrink-related parts and consolidating
them together?

> + if (error)
> + goto Thaw;

Don't we need to call dpm_complete(PMSG_RECOVER) in this error path?

> Thaw:
> thaw_kernel_threads();
> - Cleanup:
> - swsusp_free();
> goto Close;

Thanks,
Youngjun Park