Skip to content

RFC pre-mapped rw attributes

Pavel Begunkov io-uring 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4io_uring: add structure for registered argumentsinclude/linux/io_uring_types.h io_uring/io_uring.c io_uring/io_uring.h +1 more+28 -240 replies
2/4io_uring: add registered request argumentsinclude/linux/io_uring_types.h io_uring/register.c+5 -02 replies
3/4io_uring/rw: use READ_ONCE with rw attributesio_uring/rw.c+14 -80 replies
4/4io_uring/rw: pre-mapped rw attributesinclude/uapi/linux/io_uring.h io_uring/rw.c+17 -62 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/4] pre-mapped rw attributes

warning: not properly tested

Follow up on the discussion about optimising copy_from_user() for read/write attributes. The idea here is to use registered regions (see IORING_REGISTER_MEM_REGION) for that purpose pretty much in the same way registered wait arguments work.

Putting it simply, a region is a user provided chunk of memory that has been registered and pre-mapped into io_uring / kernel, but it has more modes like mmap'ing kernel memory. For attributes the user passes an offset into a region, and the kernel can read from it directly without copy_from_user().

The other alternative is to store attributes into the upper half of SQE128, but then we might run out of space in SQE for larger and/or compound attributes. It'd also require SQE128, which has a (perhaps minor) downside when other types of requests don't need it.

Pavel Begunkov (4):
io_uring: add structure for registered arguments
io_uring: add registered request arguments io_uring/rw: use READ_ONCE with rw attributes io_uring/rw: pre-mapped rw attributes

 include/linux/io_uring_types.h | 11 ++++++++--
 include/uapi/linux/io_uring.h  |  4 +++-
 io_uring/io_uring.c            | 23 +++------------------
 io_uring/io_uring.h            | 16 +++++++++++++++
 io_uring/register.c            |  7 +++++--
 io_uring/rw.c                  | 37 ++++++++++++++++++++++++----------
 6 files changed, 62 insertions(+), 36 deletions(-)
Signature · 1 line
2.47.1