Hi Pasha,
On Sat, Nov 01 2025, Pasha Tatashin wrote:
Allow users of KHO to cancel the previous preservation by adding the necessary interfaces to unpreserve folio, pages, and vmallocs.
Signed-off-by: Pasha Tatashin pasha.tatashin@soleen.com Reviewed-by: Pratyush Yadav pratyush@kernel.org Reviewed-by: Mike Rapoport (Microsoft) rppt@kernel.org
[...]
+/**
- kho_unpreserve_vmalloc - unpreserve memory allocated with vmalloc()
- @preservation: preservation metadata returned by kho_preserve_vmalloc()
- Instructs KHO to unpreserve the area in vmalloc address space that was
- previously preserved with kho_preserve_vmalloc().
- Return: 0 on success, error code on failure
- */
+int kho_unpreserve_vmalloc(struct kho_vmalloc *preservation) +{
- if (kho_out.finalized)
return -EBUSY;- kho_vmalloc_free_chunks(preservation);
When reviewing this patch, I spotted that kho_vmalloc_free_chunks() is broken. Well it happens to work if all pages are 0-order, but breaks on higher-order allocations.
I have sent a separate patch [0] to fix this on top of mm-stable. It doesn't have a conflict with this patch so it shouldn't cause trouble. And I **don't** think it should block this patch either. This is mostly a heads up.
[0] https://lore.kernel.org/linux-mm/20251103180235.71409-2-pratyush@kernel.org/...