Re: [PATCH v3] kho: add support for deferred struct page init

From: Pasha Tatashin

Date: Wed Feb 11 2026 - 14:42:18 EST


On Wed, Feb 11, 2026 at 12:40 PM Michal Clapinski <mclapinski@xxxxxxxxxx> wrote:
>
> From: Evangelos Petrongonas <epetron@xxxxxxxxx>
>
> When CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, struct page
> initialization is deferred to parallel kthreads that run later
> in the boot process.
>
> During KHO restoration, deserialize_bitmap() writes metadata for
> each preserved memory region. However, if the struct page has not been
> initialized, this write targets uninitialized memory, potentially
> leading to errors like:
> BUG: unable to handle page fault for address: ...
>
> Fix this by introducing kho_get_preserved_page(), which ensures
> all struct pages in a preserved region are initialized by calling
> init_deferred_page() which is a no-op when deferred init is disabled
> or when the struct page is already initialized.
>

Co-developed-by: Michal Clapinski <mclapinski@xxxxxxxxxx>

> Signed-off-by: Evangelos Petrongonas <epetron@xxxxxxxxx>
> Signed-off-by: Michal Clapinski <mclapinski@xxxxxxxxxx>
> Reviewed-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
> ---
> v3:
> - changed commit msg
> - don't invoke early_pfn_to_nid if CONFIG_DEFERRED_STRUCT_PAGE_INIT=n

Reviewed-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>

Thanks,
Pasha