> > > > The patch looks okay to me, but it doesn't support holes in vmap > > > > areas. While that is likely acceptable for vmalloc, it could be a > > > > problem if we want to preserve memfd with holes and using vmap > > > > preservation as a method, which would require a different approach. > > > > Still, this would help with preserving memfd. > > > > > > I agree. I think we should do it the other way round. Build a sparse > > > array first, and then use that to build vmap preservation. Our emails > > > > Yes, sparse array support would help both: vmalloc and memfd preservation. > > Why? vmalloc is always full popoulated, no sparseness.. vmalloc is always fully populated, but if we add support for preserving an area with holes, it can also be used for preserving vmalloc. 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. > 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.