public inbox for [email protected]
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] io_uring/splice: extend splice for supporting ublk zero copy
@ 2022-11-03  8:50 Ming Lei
  2022-11-03  8:50 ` [RFC PATCH 1/4] io_uring/splice: support do_splice_direct Ming Lei
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Ming Lei @ 2022-11-03  8:50 UTC (permalink / raw)
  To: Jens Axboe, io-uring
  Cc: linux-block, linux-kernel, linux-fsdevel, Miklos Szeredi,
	Stefan Hajnoczi, ZiyangZhang, Ming Lei

Hello Guys,

This patch extends io_uring/splice by adding two flags(SPLICE_F_DIRECT &
SPLICE_F_READ_TO_READ) for supporting ublk zero copy, and fuse could benefit
from the change too.

- SPLICE_F_DIRECT is for using do_splice_direct() to support zero copy

- SPLICE_F_READ_TO_READ is for supporting ublk READ zero copy, the plain
splice can support WRITE zero copy by:

	splice(ublkc_fd, ublkc_pos, pipe_wr_fd, NULL, len, flags)
	splice(pipe_rd_fd, NULL, backing_fd, backing_off, len, flags)

but can't support READ zc. Extend splice to allow to splice from the 1st
->splice_read()(producer) to the 2nd ->splice_read()(consumer), then READ
request pages reference can be transferred to backing IO code path.

The initial idea is suggested by Miklos Szeredi & Stefan Hajnoczi.

The patchset has been verified basically by ublk builtin tests(loop/008,
loop/009, generic/003), and basic mount, git clone, kernel building, umount
tests on ublk-loop[1] which is created by 'ublk add -t loop -f $backing -z'.

The next step is to allow io_uring to run do_splice_direct*()
in async style like normal async RW instead of offloading to
iowq context, so that top performance can be reached, and that
depends on current work.

Any comments are welcome.

[1] https://github.com/ming1/ubdsrv/commits/splice-zc


Ming Lei (4):
  io_uring/splice: support do_splice_direct
  fs/splice: add helper of splice_dismiss_pipe()
  io_uring/splice: support splice from ->splice_read to ->splice_read
  ublk_drv: support splice based read/write zero copy

 drivers/block/ublk_drv.c      | 151 +++++++++++++++++++++++++-
 fs/read_write.c               |   5 +-
 fs/splice.c                   | 193 +++++++++++++++++++++++++++++-----
 include/linux/fs.h            |   2 +
 include/linux/pipe_fs_i.h     |   9 ++
 include/linux/splice.h        |  14 +++
 include/uapi/linux/ublk_cmd.h |  34 +++++-
 io_uring/splice.c             |  16 ++-
 8 files changed, 392 insertions(+), 32 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-11-08  8:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03  8:50 [RFC PATCH 0/4] io_uring/splice: extend splice for supporting ublk zero copy Ming Lei
2022-11-03  8:50 ` [RFC PATCH 1/4] io_uring/splice: support do_splice_direct Ming Lei
2022-11-08  7:42   ` Christoph Hellwig
2022-11-03  8:50 ` [RFC PATCH 2/4] fs/splice: add helper of splice_dismiss_pipe() Ming Lei
2022-11-03  8:50 ` [RFC PATCH 3/4] io_uring/splice: support splice from ->splice_read to ->splice_read Ming Lei
2022-11-08  7:45   ` Christoph Hellwig
2022-11-08  8:29     ` Ming Lei
2022-11-03  8:50 ` [RFC PATCH 4/4] ublk_drv: support splice based read/write zero copy Ming Lei
2022-11-03 22:28   ` Bernd Schubert
2022-11-04  0:44     ` Ming Lei
2022-11-04 23:37       ` Bernd Schubert
2022-11-07  1:05         ` Ming Lei
2022-11-04  9:15 ` [RFC PATCH 0/4] io_uring/splice: extend splice for supporting ublk " Ziyang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox