Hi, Alex, On Tue, May 20, 2025 at 08:07:19AM -0600, Alex Williamson wrote: > Peter, David, if you wouldn't mind double checking the folio usage > here, I'd appreciate it. The underlying assumption used here is that > folios always have physically contiguous pages, so we can increment at > the remainder of the folio_nr_pages() rather than iterate each page. Yes I think so. E.g., there's comment above folio definition too: /** * struct folio - Represents a contiguous set of bytes. * ... * A folio is a physically, virtually and logically contiguous set * of bytes... */ For 1G, I wonder if in the future vfio can also use memfd_pin_folios() internally when possible, e.g. after stumbled on top of a hugetlb folio when filling the batch. Thanks, -- Peter Xu