lkml.org 
[lkml]   [2020]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4 1/2] vfio dma_map/unmap: optimized for hugetlbfs pages
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.

Actually already merged. There's page_size() which went into 5.4, and
is the one you'd want to use (also page_shift() and compound_nr()).
The thp_* equivalents (merged in 5.9) compile away to nothing if you
don't have CONFIG_TRANSPARENT_HUGEPAGE enabled, but since there are
many ways of getting a compound page mapped into userspace, page_size()
is the helper to use for VFIO.

\
 
 \ /
  Last update: 2020-09-09 19:13    [W:0.049 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site