[PATCH] mm/page_alloc: enclose kho-specific code with CONFIG_KEXEC_HANDOVER

From: SeongJae Park

Date: Tue Mar 17 2026 - 19:56:17 EST


Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
---
mm/page_alloc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5ca078dde61d6..ed4d585f46202 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -550,11 +550,13 @@ void __meminit init_pageblock_migratetype(struct page *page,
migratetype < MIGRATE_PCPTYPES))
migratetype = MIGRATE_UNMOVABLE;

+#ifdef CONFIG_KEXEC_HANDOVER
/*
* Mark KHO scratch as CMA so no unmovable allocations are made there.
*/
if (unlikely(kho_scratch_overlap(page_to_phys(page), PAGE_SIZE)))
migratetype = MIGRATE_CMA;
+#endif

flags = migratetype;

--
2.47.3