Re: [RFC PATCH v3 0/8] batch lookups in follow_page_mask()

From: Rik van Riel

Date: Tue Aug 25 2026 - 09:49:02 EST


On Tue, 2026-08-25 at 00:52 -0700, Christoph Hellwig wrote:
> On Mon, Aug 10, 2026 at 10:51:49PM -0400, Rik van Riel wrote:
> > follow_page_mask() walks the page tables one page at a time, even
> > when the
> > caller asked for a whole run of contiguous pages. Every page of a
> > large folio
> > re-enters the pmd/pud/pte walk and re-takes the page table lock.
> >
> > This series changes follow_page_mask() to return a page count and a
> > fill an
> > array of pages, instead of a single struct page, so a walker can
> > hand back
> > more than one page per call.
>
> And what many including the most performance critical callers want
> instead is really a single bio_vec.  Maybe we can go the extra step
> for
> that, as it would reduce the number of calls into gup significantly.
>
Which code are you referring to here?

blk_rq_map_user() seems to end up calling pin_user_pages_fast(),
via iov_iter_extract_user_pages, and it directly fills in the
bio_vec's pages array.

Is there another performance critical path that goes
through the slower get_user_pages() path?

--
All Rights Reversed.