[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mafs0ecqvfazg.fsf@kernel.org>
Date: Wed, 22 Oct 2025 13:10:27 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: akpm@...ux-foundation.org, brauner@...nel.org, corbet@....net,
graf@...zon.com, jgg@...pe.ca, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
masahiroy@...nel.org, ojeda@...nel.org, pratyush@...nel.org,
rdunlap@...radead.org, rppt@...nel.org, tj@...nel.org
Subject: Re: [PATCHv7 4/7] kho: add interfaces to unpreserve folios and page
ranges
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@...een.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@...nel.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 *);
> };
--
Regards,
Pratyush Yadav
Powered by blists - more mailing lists