[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200909080114.GA8321@infradead.org>
Date: Wed, 9 Sep 2020 09:01:14 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Ming Mao <maoming.maoming@...wei.com>
Cc: 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,
willy@...radead.org, jhubbard@...dia.com
Subject: Re: [PATCH V4 1/2] vfio dma_map/unmap: optimized for hugetlbfs pages
I really don't think this approach is any good. You workaround
a deficiency in the pin_user_pages API in one particular caller for
one particular use case.
I think you'd rather want either:
(1) a FOLL_HUGEPAGE flag for the pin_user_pages API family that returns
a single struct page for any kind of huge page, which would also
benefit all kinds of other users rather than adding these kinds of
hacks to vfio.
(2) add a bvec version of the API that returns a variable size
"extent"
I had started on (2) a while ago, and here is branch with my code (which
is broken and fails test, but might be a start):
http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/gup-bvec
But for now I wonder if (1) is the better start, which could still be
reused to (2) later.
Powered by blists - more mailing lists