From: "David Hildenbrand (Arm)" <david@kernel.org>
To: sw.prabhu6@gmail.com, axboe@kernel.dk, io-uring@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, dave@stgolabs.net,
dongjoo.seo1@samsung.com, Swarna Prabhu <s.prabhu@samsung.com>
Subject: Re: [RFC v1] io_uring/rsrc: add fast path huge page handling in buffer registration
Date: Tue, 9 Jun 2026 20:36:43 +0200 [thread overview]
Message-ID: <c924fb59-be47-4fa5-adbf-a50a831ccd7b@kernel.org> (raw)
In-Reply-To: <20260608062937.804758-1-sw.prabhu6@gmail.com>
> +struct page **io_pin_pages_fast_path(unsigned long uaddr, unsigned long len, int *npages)
> +{
> + unsigned long nr_pages;
> + struct page **pages;
> + int ret;
> +
> + pages = io_pin_pages_alloc(uaddr, len, &nr_pages);
> + if (IS_ERR(pages))
> + return pages;
> +
> + ret = pin_user_pages_fast(uaddr, nr_pages, FOLL_WRITE | FOLL_LONGTERM,
> + pages);
> + /* success, mapped all pages */
> + if (ret == nr_pages) {
> + struct folio *folio = page_folio(pages[0]);
> +
> + if (nr_pages > 1 && folio_test_hugetlb(folio) &&
> + page_folio(pages[nr_pages - 1]) == folio) {
I really don't like arbitrary GUP users to starting to special case hugetlb
folios, and making assumptions of how other pages they pinned look like (IOW,
how the page table mappings actually looked like).
Ideally, we'd have a pin_user_pages_fast() variant that would give you a list of
folio ranges instead of individual pages.
Seeing GUP users open-coded that (and special-casing on hugetlb) is a warning sign.
Assume we have a PMD-mapped (or even pte-mapped) THP, we would want the exact
same performance speedup. GUP knows that stuff belongs to the same folio, just
needs to communicate that information back in a better way.
So a no from my side.
--
Cheers,
David
next prev parent reply other threads:[~2026-06-09 18:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 6:29 [RFC v1] io_uring/rsrc: add fast path huge page handling in buffer registration sw.prabhu6
2026-06-08 15:57 ` Jens Axboe
2026-06-09 2:18 ` Swarna Prabhu
2026-06-09 18:36 ` David Hildenbrand (Arm) [this message]
2026-06-10 6:16 ` Christoph Hellwig
2026-06-10 9:54 ` David Hildenbrand (Arm)
2026-06-10 11:34 ` Christoph Hellwig
2026-06-10 13:18 ` David Hildenbrand (Arm)
2026-06-10 18:10 ` Matthew Wilcox
2026-06-10 18:45 ` David Hildenbrand (Arm)
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=c924fb59-be47-4fa5-adbf-a50a831ccd7b@kernel.org \
--to=david@kernel.org \
--cc=axboe@kernel.dk \
--cc=dave@stgolabs.net \
--cc=dongjoo.seo1@samsung.com \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.prabhu@samsung.com \
--cc=sw.prabhu6@gmail.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