Skip to content

fuse: support io-uring registered buffers

Joanne Koong io-uring linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest8 patches 31 repliesIn review

Changes in v2 from the cover letter

* Add io_uring_cmd_import_fixed_full() patch
* Construct iter using io_uring_cmd_import_fixed_full() per cmd instead of recyling iters.
* Kmap the header instead of using bvec iter for iterating/copying. This makes the code easier to read.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8io_uring/uring_cmd: add io_uring_cmd_import_fixed_full()include/linux/io_uring/cmd.h io_uring/rsrc.c io_uring/rsrc.h +1 more+32 -011 replies
2/8fuse: refactor io-uring logic for getting next fuse requestfs/fuse/dev_uring.c+28 -501 reply
3/8fuse: refactor io-uring header copying to ringfs/fuse/dev_uring.c+20 -182 replies
4/8fuse: refactor io-uring header copying from ringfs/fuse/dev_uring.c+17 -60 replies
5/8fuse: use enum types for header copyingfs/fuse/dev_uring.c+45 -103 replies
6/8fuse: add user_ prefix to userspace headers and payload fieldsfs/fuse/dev_uring.c fs/fuse/dev_uring_i.h+10 -113 replies
7/8fuse: refactor setting up copy state for payload copyingfs/fuse/dev_uring.c+25 -142 replies
8/8fuse: support io-uring registered buffersfs/fuse/dev_uring.c fs/fuse/dev_uring_i.h+183 -448 replies

Reviews trailers per patch

4 of 8 patches have a Reviewed-by or Acked-by.

PatchCaleb Sander MateosBernd Schubert
1/8R-b
2/8R-b
3/8
4/8
5/8R-b
6/8Reviwed-by
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] fuse: support io-uring registered buffers

This patchset adds fuse support for io-uring registered buffers. Daemons may register buffers ahead of time, which will eliminate the overhead of pinning/unpinning user pages and translating virtual addresses for every server-kernel interaction.

The main logic for fuse registered buffers is in the last patch (patch 8/8). Patch 1/8 adds an io_uring api for fetching the registered buffer and patches (2-7)/8 refactors the fuse io_uring code, which additionally will make adding in the logic for registered buffers neater.

The libfuse changes can be found in this branch:
https://github.com/joannekoong/libfuse/tree/registered_buffers. The libfuse implementation first tries registered buffers during registration and if this fails, will retry with non-registered buffers. This prevents having to add a new init flag (but does have the downside of printing dmesg errors for the failed registrations when trying the registered buffers). If using registered buffers and the daemon for whatever reason unregisters the buffers midway through, then this will sever server-kernel communication. Libfuse will never do this. Libfuse will only unregister the buffers when the entire session is being destroyed.

Benchmarks will be run and posted.

Thanks,
Joanne

v1: https://lore.kernel.org/linux-fsdevel/[email protected]/
v1 -> v2:
* Add io_uring_cmd_import_fixed_full() patch
* Construct iter using io_uring_cmd_import_fixed_full() per cmd instead of recyling iters.
* Kmap the header instead of using bvec iter for iterating/copying. This makes the code easier to read.

Joanne Koong (8):
io_uring/uring_cmd: add io_uring_cmd_import_fixed_full()
fuse: refactor io-uring logic for getting next fuse request
fuse: refactor io-uring header copying to ring
fuse: refactor io-uring header copying from ring
fuse: use enum types for header copying
fuse: add user_ prefix to userspace headers and payload fields
fuse: refactor setting up copy state for payload copying
fuse: support io-uring registered buffers

 fs/fuse/dev_uring.c          | 366 +++++++++++++++++++++++++----------
 fs/fuse/dev_uring_i.h        |  27 ++-
 include/linux/io_uring/cmd.h |   3 +
 io_uring/rsrc.c              |  14 ++
 io_uring/rsrc.h              |   2 +
 io_uring/uring_cmd.c         |  13 ++
 6 files changed, 316 insertions(+), 109 deletions(-)
Signature · 1 line
2.47.3