[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 9 Sep 2020 16:00:15 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Jason Gunthorpe <jgg@...pe.ca>,
Ming Mao <maoming.maoming@...wei.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-mm@...ck.org, alex.williamson@...hat.com,
akpm@...ux-foundation.org, cohuck@...hat.com,
jianjay.zhou@...wei.com, weidong.huang@...wei.com,
peterx@...hat.com, aarcange@...hat.com, wangyunjian@...wei.com,
jhubbard@...dia.com
Subject: Re: [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.
Powered by blists - more mailing lists