Re: [RFC PATCH v3 0/8] batch lookups in follow_page_mask()
From: Christoph Hellwig
Date: Wed Aug 26 2026 - 00:39:35 EST
On Tue, Aug 25, 2026 at 09:37:09AM -0400, Rik van Riel wrote:
> > 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?
The other callers of iov_iter_extract_bvecs matter more, but this is
the main user.
And iov_iter_extract_bvecs right now is very inefficient when used
on larger folios, as each call to iov_iter_extract_bvecs and thus
iov_iter_extract_pages and iov_iter_extract_user_pages can only
fill in up to 256 pages. On x86 that is a single PMD mapped
folio. Passing down the bio_vec array means that for PMD-mapped
ranges we reduce the calls into pin_user_pages_fast by a factor
of 256.