[PATCH 6.18.y 0/2] kho: free buddy-allocated metadata with free_page()
Federico Parola
fparola at amazon.de
Thu Oct 15 07:45:27 PDT 2026
Commit fa759cd75bce ("kho: allocate metadata directly from the buddy
allocator"), merged in 6.18, moved the KHO serialization chunks and the
preserved memory bitmaps from kzalloc() to get_zeroed_page(). Two places
still release them with kfree(): kho_mem_ser_free() for the chunks and
__kho_abort() for the bitmaps. kfree() on such a page hits the
WARN_ON_ONCE() in free_large_kmalloc() and returns without freeing it,
so each aborted or failed KHO finalization leaks the metadata pages.
Patch 1 is a clean backport of the upstream fix for the chunks.
Patch 2 fixes the bitmaps and has no upstream counterpart. Upstream
removed the tracking teardown from __kho_abort() in commit 99cd2ffac697
("kho: don't unpreserve memory during abort"), which relies on the
unpreserve interfaces and the notifier removal that came with 6.19. In
6.18.y, KHO users still preserve memory from the KEXEC_KHO_FINALIZE
notifier, and the teardown on abort is the only thing that drops those
preservations. I kept it and changed only the free; patch 2 has the
details.
Federico Parola (1):
kho: free phys_bits bitmaps using free_page() in __kho_abort()
Pratyush Yadav (1):
kho: free chunks using free_page() instead of kfree()
kernel/kexec_handover.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.47.3
More information about the kexec
mailing list