Re: [PATCH V4 1/2] vfio dma_map/unmap: optimized for hugetlbfs pages

From: Jason Gunthorpe
Date: Wed Sep 09 2020 - 13:13:19 EST

On Wed, Sep 09, 2020 at 03:29:41PM +0100, Christoph Hellwig wrote:
> On Wed, Sep 09, 2020 at 10:05:18AM -0300, Jason Gunthorpe wrote:
> > How to use? The VMAs can have mixed page sizes so the caller would
> > have to somehow switch and call twice? Not sure this is faster.
> We can find out the page size based on the page. Right now it is
> rather cumbersome, but one of willys pending series has a nicer helper
> for that.

So, returns a packed array of pinned head page pointers where each
element's length is determined by page_size()?

Some maths from VA figure out the initial page offset and final page

Could this representation work effectively for general DMA mapping

Put the array in chained pages like SGL so it can efficiently cover
very large amounts of VA?