public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: Bernd Schubert <bschubert@ddn.com>
Cc: miklos@szeredi.hu, axboe@kernel.dk,
	linux-fsdevel@vger.kernel.org,  asml.silence@gmail.com,
	io-uring@vger.kernel.org, xiaobing.li@samsung.com
Subject: Re: [PATCH v1 0/2] fuse io_uring: support registered buffers
Date: Fri, 24 Oct 2025 12:37:47 -0700	[thread overview]
Message-ID: <CAJnrk1Y3z1=douWdDDxnq0bWOTggKEgrrZrLGO+0wcA028MxPg@mail.gmail.com> (raw)
In-Reply-To: <a2aaea17-0719-425e-8999-16a8367c57e7@ddn.com>

On Fri, Oct 24, 2025 at 11:12 AM Bernd Schubert <bschubert@ddn.com> wrote:
>
> On 10/24/25 00:27, Joanne Koong wrote:
> > On Wed, Oct 22, 2025 at 1:43 PM Bernd Schubert <bschubert@ddn.com> wrote:
> >>
> >> On 10/22/25 22:20, Joanne Koong wrote:
> >>> This adds support for daemons who preregister buffers to minimize the overhead
> >>> of pinning/unpinning user pages and translating virtual addresses. Registered
> >>> buffers pay the cost once during registration then reuse the pre-pinned pages,
> >>> which helps reduce the per-op overhead.
> >>>
> >>> This is on top of commit 211ddde0823f in the iouring tree.
> >>
> >> Interesting, on a first glance this looks like an alternative
> >> implementation of page pinning
> >>
> >> https://lore.kernel.org/all/20240901-b4-fuse-uring-rfcv3-without-mmap-v3-17-9207f7391444@ddn.com/
> >>
> >> At DDN we are running with that patch (changed commit message) and another
> >> one that avoids io_uring_cmd_complete_in_task() - with pinned pages
> >> the IO submitting application can directly write into header and payload
> >> (note that the latter also required pinned headers)
> >>
> >> Going to look into your approach tomorrow.
> >
> > Thanks for taking a look when you get the chance. The libfuse changes
> > are in this branch
> > https://github.com/joannekoong/libfuse/tree/registered_buffers btw.
>
> Sorry, still didn't manage another task for tomorrow. Btw, the reason
> hadn't sent my patches is that I hadn't handled memory accounting yet.
> And then got busy with other tasks for much too long...
>
> I see in io_sqe_buffers_register() how that is done, although I'm
> confused why it first calls io_pin_pages() and only then accounts. I.e.
> it can temporarily go above the limit - I wonder what happens if the
> user opens another application that time that just needs a little locked
> memory...
>
> In general I think your solution more complex than mine - I think I'm
> going to update my patches (there are conflicts due to folio conversion)
> and then we can compare.

Hi Bernd,

I think this solution is actually less complex because all the pinning
and accounting stuff is taken care of by io-uring and there's one
pinned buffer instead of pinning the header and payload separately.

I think the part that looks complex maybe is the integration of the
bvec iter with header copying. For v2 I have it vastly simplified so
that we just kmap the header, which makes it play more nicely with
directly accessing the header struct members instead of going through
the bvec iter.

Thanks,
Joanne

>
>
> Thanks,
> Bernd

  reply	other threads:[~2025-10-24 19:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 20:20 [PATCH v1 0/2] fuse io_uring: support registered buffers Joanne Koong
2025-10-22 20:20 ` [PATCH v1 1/2] io-uring: add io_uring_cmd_get_buffer_info() Joanne Koong
2025-10-23  3:16   ` Caleb Sander Mateos
2025-10-23 22:20     ` Joanne Koong
2025-10-24  0:00       ` Joanne Koong
2025-10-22 20:20 ` [PATCH v1 2/2] fuse: support io-uring registered buffers Joanne Koong
2025-10-23  3:22   ` Caleb Sander Mateos
2025-10-23 12:39   ` kernel test robot
2025-10-23 13:22   ` kernel test robot
2025-10-23 17:42     ` Joanne Koong
2025-10-23 23:44   ` Joanne Koong
2025-10-22 20:43 ` [PATCH v1 0/2] fuse io_uring: support " Bernd Schubert
2025-10-23 22:27   ` Joanne Koong
2025-10-24 18:12     ` Bernd Schubert
2025-10-24 19:37       ` Joanne Koong [this message]
     [not found] ` <CGME20251023114956epcas5p33a9384d06985dc5936fd355f1d580fb2@epcas5p3.samsung.com>
2025-10-23 11:45   ` Xiaobing Li
2025-10-24 18:02     ` Joanne Koong

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='CAJnrk1Y3z1=douWdDDxnq0bWOTggKEgrrZrLGO+0wcA028MxPg@mail.gmail.com' \
    --to=joannelkoong@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bschubert@ddn.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=xiaobing.li@samsung.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