 
            On Tue, Oct 21 2025, Pasha Tatashin wrote:
Allow users of KHO to cancel the previous preservation by adding the necessary interfaces to unpreserve folio and pages.
Signed-off-by: Pasha Tatashin pasha.tatashin@soleen.com
include/linux/kexec_handover.h | 12 +++++ kernel/kexec_handover.c | 85 ++++++++++++++++++++++++++++------ 2 files changed, 84 insertions(+), 13 deletions(-)
[...]
+/**
- kho_unpreserve_pages - unpreserve contiguous pages.
- @page: first page in the list.
- @nr_pages: number of pages.
- Instructs KHO to unpreserve @nr_pages contigious pages starting from @page.
s/contigious/contiguous. Also drop the extra space after it.
- This call must exactly match a granularity at which memory was originally
- preserved by kho_preserve_pages, call with the same @page and
- @nr_pages). Unpreserving arbitrary sub-ranges of larger preserved blocks is
Stray closing parenthesis here. Perhaps a rewording to: "This must be called with the same @page and @nr_pages as the corresponding kho_preserve_pages() call. Unpreserving arbitrary..."
Other than this,
Reviewed-by: Pratyush Yadav pratyush@kernel.org
- not supported.
- Return: 0 on success, error code on failure
- */
+int kho_unpreserve_pages(struct page *page, unsigned int nr_pages) +{
- struct kho_mem_track *track = &kho_out.track;
- const unsigned long start_pfn = page_to_pfn(page);
- const unsigned long end_pfn = start_pfn + nr_pages;
- if (kho_out.finalized)
return -EBUSY;- __kho_unpreserve(track, start_pfn, end_pfn);
- return 0;
+} +EXPORT_SYMBOL_GPL(kho_unpreserve_pages);
struct kho_vmalloc_hdr { DECLARE_KHOSER_PTR(next, struct kho_vmalloc_chunk *); };