Skip to content

io_uring: use ITER_UBUF

Keith Busch io-uring linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iov: add import_ubuf()include/linux/uio.h lib/iov_iter.c+12 -02 replies
2/4io_uring: switch network send/recv to ITER_UBUFio_uring/net.c+4 -90 replies
3/4io_uring: use ubuf for single range imports for read/writeio_uring/rw.c+6 -30 replies
4/4iov_iter: move iter_ubuf check inside restore WARNlib/iov_iter.c+2 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] io_uring: use ITER_UBUF

From: Keith Busch <[email protected]>

ITER_UBUF is a more efficient representation when using single vector buffers, providing small optimizations in the fast path. Most of this series came from Jens; I just ported them forward to the current release and tested against various filesystems and devices.

Usage for this new iter type has been extensively exercised via read/write syscall interface for some time now, so I don't expect surprises from supporting this with io_uring. There are, however, a couple difference between the two interfaces:

1. io_uring will always prefer using the _iter versions of read/write callbacks if file_operations implement both, where as the generic syscalls will use .read/.write (if implemented) for non-vectored IO.

2. io_uring will use the ITER_UBUF representation for single vector readv/writev, but the generic syscalls currently uses ITER_IOVEC for these.

That should mean, then, the only potential areas for problem are for file_operations that implement both .read/.read_iter or .write/.write_iter. Fortunately there are very few that do that, and I found only two of them that won't readily work: qib_file_ops, and snd_pcm_f_ops. The former is already broken with io_uring before this series, and the latter's vectored read/write only works with ITER_IOVEC, so that will break, but I don't think anyone is using io_uring to talk to a sound card driver.

Jens Axboe (3):
iov: add import_ubuf()
io_uring: switch network send/recv to ITER_UBUF
io_uring: use ubuf for single range imports for read/write

Keith Busch (1):
iov_iter: move iter_ubuf check inside restore WARN

 include/linux/uio.h |  1 +
 io_uring/net.c      | 13 ++++---------
 io_uring/rw.c       |  9 ++++++---
 lib/iov_iter.c      | 15 +++++++++++++--
 4 files changed, 24 insertions(+), 14 deletions(-)
Signature · 1 line
2.30.2