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

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

From: Mike Rapoport <rppt@kernel.org>
Date: 2025-09-25 05:26:43
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Sun, Sep 21, 2025 at 06:20:50PM -0400, Pasha Tatashin wrote:
On Mon, Aug 18, 2025 at 9:55 AM Jason Gunthorpe [off-list ref] wrote:
quoted
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);
Why not add them to KHO?
 
Allocate contiguous, zeroed, and preserved memory.

Pasha
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help