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

Re: [PATCH v3 29/30] luo: allow preserving memfd

flat view

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-09-03 16:40:48
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Wed, Sep 03, 2025 at 03:59:40PM +0000, Pasha Tatashin wrote:
vmalloc is always fully populated, but if we add support for
preserving an area with holes, it can also be used for preserving
vmalloc. 
Why? If you can't create it with vmap what is the point?
By the way, I don't like calling it *vmalloc* preservation
because we aren't preserving the original virtual addresses; we are
preserving a list of pages that are reassembled into a virtually
contiguous area. Maybe kho map, or kho page map, not sure, but vmalloc
does not sound right to me.
No preservation retains the virtual address, that is pretty much
universal.

It is vmalloc preservation because the flow is

 x = vmalloc()
 kho_preserve_vmalloc(x, &preserved)
 [..]
 x = kho_restore_vmalloc(preserved)
 vfree(x)

It is the same naming as folio preservation. Upon restore you get a
vmalloc() back.
quoted
And again in real systems we expect memfd to be fully populated too.
I thought so too, but we already have a use case for slightly sparse
memfd, unfortunately, that becomes *very* inefficient when fully
populated.
Really? Why not use multiple memfds :(

So maybe you need to do optimized sparseness in memfd :(

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