public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <viro@zeniv.linux.org.uk>, <axboe@kernel.dk>, <io-uring@vger.kernel.org>
Cc: <asml.silence@gmail.com>, <linux-fsdevel@vger.kernel.org>,
	Keith Busch <kbusch@kernel.org>
Subject: [PATCH 0/4] io_uring: use ITER_UBUF
Date: Mon, 7 Nov 2022 09:56:06 -0800	[thread overview]
Message-ID: <20221107175610.349807-1-kbusch@meta.com> (raw)

From: Keith Busch <kbusch@kernel.org>

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(-)

-- 
2.30.2


             reply	other threads:[~2022-11-07 17:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 17:56 Keith Busch [this message]
2022-11-07 17:56 ` [PATCH 1/4] iov: add import_ubuf() Keith Busch
2022-11-08  6:55   ` Christoph Hellwig
2022-11-08 16:05     ` Keith Busch
2022-11-07 17:56 ` [PATCH 2/4] io_uring: switch network send/recv to ITER_UBUF Keith Busch
2022-11-07 17:56 ` [PATCH 3/4] io_uring: use ubuf for single range imports for read/write Keith Busch
2022-11-07 17:56 ` [PATCH 4/4] iov_iter: move iter_ubuf check inside restore WARN Keith Busch
2022-11-08  6:54 ` [PATCH 0/4] io_uring: use ITER_UBUF Christoph Hellwig
2022-11-08 20:25   ` Keith Busch

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=20221107175610.349807-1-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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