Skip to content

Provide more efficient buffer registration

Jens Axboe io-uring 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v23 patches 0 repliesSuperseded
  3. v13 patches 1 replySuperseded

Changes in v3 from the cover letter

- Ensure that it works for registered rings (both src/dst)
- Little cleanups

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4io_uring/rsrc: clear 'slot' entry upfrontio_uring/rsrc.c+1 -10 replies
2/4io_uring/rsrc: add reference count to struct io_mapped_ubufio_uring/rsrc.c io_uring/rsrc.h+4 -00 replies
3/4io_uring/register: provide helper to get io_ring_ctx from 'fd'io_uring/register.c io_uring/register.h+34 -210 replies
4/4io_uring: add IORING_REGISTER_COPY_BUFFERS methodinclude/uapi/linux/io_uring.h io_uring/register.c io_uring/rsrc.c +1 more+111 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHSET v3 0/4] Provide more efficient buffer registration

Hi,

Pretty much what the subject line says, it's about 25k to 40k times faster to provide a way to duplicate an existing rings buffer registration than it is manually map/pin/register the buffers again with a new ring.

Patch 1 is just a prep patch, patch 2 adds refs to struct io_mapped_ubuf, patch 3 abstracts out a helper, and patch 4 finally adds the register opcode to allow a ring to duplicate the registered mappings from one ring to another.

This came about from discussing overhead from the varnish cache project for cases with more dynamic ring/thread creation.

Also see the buf-copy liburing branch for support and test code:

https://git.kernel.dk/cgit/liburing/log/?h=buf-copy

 include/uapi/linux/io_uring.h | 13 +++++
 io_uring/register.c           | 60 ++++++++++++++--------
 io_uring/register.h           |  1 +
 io_uring/rsrc.c               | 96 ++++++++++++++++++++++++++++++++++-
 io_uring/rsrc.h               |  2 +
 5 files changed, 150 insertions(+), 22 deletions(-)

Since v2:
- Ensure that it works for registered rings (both src/dst)
- Little cleanups

Signature · 1 line
Jens Axboe