]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kho: fix deferred initialization of scratch areas
authorMichal Clapinski <mclapinski@google.com>
Thu, 23 Apr 2026 12:25:36 +0000 (14:25 +0200)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 31 May 2026 23:31:37 +0000 (02:31 +0300)
commitbf480c6133461a60e8a4486e560550a20e40ac11
tree1d415ad964d44cbc25bd57a7fd2ea57ea212eef0
parente43ffb69e0438cddd72aaa30898b4dc446f664f8
kho: fix deferred initialization of scratch areas

Currently, if CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled,
kho_release_scratch() will initialize the struct pages and set migratetype
of KHO scratch. Unless the whole scratch fits below first_deferred_pfn,
some of that will be overwritten either by deferred_init_pages() or
memmap_init_reserved_range().

To fix it, make memmap_init_range(), deferred_init_memmap_chunk() and
__init_page_from_nid() recognize KHO scratch regions and set
migratetype of pageblocks in those regions to MIGRATE_CMA.

Co-developed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Michal Clapinski <mclapinski@google.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20260423122538.140993-2-mclapinski@google.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
include/linux/memblock.h
kernel/liveupdate/kexec_handover.c
mm/memblock.c
mm/mm_init.c