Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Christoph Hellwig <hch@infradead.org>, Rik van Riel <riel@surriel.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH v3 0/8] batch lookups in follow_page_mask()
Date: Wed, 26 Aug 2026 10:27:12 +0200	[thread overview]
Message-ID: <63a72a5c-6e24-4513-a83c-d8f63df3a600@kernel.org> (raw)
In-Reply-To: <ao6XSh1YRiqPA3rA@infradead.org>

On 8/26/26 09:35, Christoph Hellwig wrote:
> On Tue, Aug 25, 2026 at 09:39:14PM -0700, Christoph Hellwig wrote:
>> 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.
> 
> Also in addition to reducing the calls to pin_user_pages_fast, it also
> removes a fair amount of work to recalculate the bio_len in the
> get_contig_folio_len loop in iov_iter_extract_bvecs, which has shown up
> in profiles (although only marginally so).

We could think of a mechanism that fills a given structure in a better way, and
I think we recently discussed returning folio ranges, and might to that through
something like phyr (or however that is called :) ).

But that's really not something is would mix into this work here.

-- 
Cheers,

David


  reply	other threads:[~2026-08-26  8:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  2:51 [RFC PATCH v3 0/8] batch lookups in follow_page_mask() Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 1/8] mm/gup: break out gup_fill_pages() helper Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 2/8] mm/gup: convert follow_page_mask() to return a long Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 3/8] mm/gup: split follow_page_pte_commit() out of follow_page_pte() Rik van Riel
2026-08-12 11:50   ` David Hildenbrand (Arm)
2026-08-12 13:02     ` Rik van Riel
2026-08-12 13:23       ` David Hildenbrand (Arm)
2026-08-12 16:19         ` Rik van Riel
2026-08-21 17:38         ` Rik van Riel
2026-08-21 22:04           ` John Hubbard
2026-08-22 13:20             ` Rik van Riel
2026-08-22 21:31               ` John Hubbard
2026-08-24 13:20                 ` Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 4/8] mm/gup: break out follow_one_pte() helper Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 5/8] mm/gup: fill the pages array outside the pud/pmd lock Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 6/8] mm/gup: return a huge page's full count from follow_page_mask() Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 7/8] mm/gup: walk multiple PTEs per follow_page_pte() call Rik van Riel
2026-08-11  2:51 ` [RFC PATCH v3 8/8] mm/gup: batch contiguous same-folio PTEs into one refcount grab Rik van Riel
2026-08-12 11:41 ` [RFC PATCH v3 0/8] batch lookups in follow_page_mask() David Hildenbrand (Arm)
2026-08-25  7:52 ` Christoph Hellwig
2026-08-25 13:37   ` Rik van Riel
2026-08-26  4:39     ` Christoph Hellwig
2026-08-26  7:35       ` Christoph Hellwig
2026-08-26  8:27         ` David Hildenbrand (Arm) [this message]
2026-08-26 13:36       ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63a72a5c-6e24-4513-a83c-d8f63df3a600@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=riel@surriel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox