Thread (137 messages) 137 messages, 11 authors, 2025-10-09

Re: [PATCH v3 07/30] kho: add interfaces to unpreserve folios and physical memory ranges

From: Pasha Tatashin <pasha.tatashin@soleen.com>
Date: 2025-09-21 22:21:28
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Mon, Aug 18, 2025 at 9:55 AM Jason Gunthorpe [off-list ref] wrote:
On Fri, Aug 15, 2025 at 12:12:10PM +0300, Mike Rapoport wrote:
quoted
quoted
Which is perhaps another comment, if this __get_free_pages() is going
to be a common pattern (and I guess it will be) then the API should be
streamlined alot more:

 void *kho_alloc_preserved_memory(gfp, size);
 void kho_free_preserved_memory(void *);
This looks backwards to me. KHO should not deal with memory allocation,
it's responsibility to preserve/restore memory objects it supports.
Then maybe those are luo_ helpers

But having users open code __get_free_pages() and convert to/from
struct page, phys, etc is not a great idea.
I added:

void *luo_contig_alloc_preserve(size_t size);
void luo_contig_free_unpreserve(void *mem, size_t size);

Allocate contiguous, zeroed, and preserved memory.

Pasha
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help