Skip to content

io_uring: add IORING_OP_READ[WRITE]_SPLICE_BUF

Ming Lei io-uring linux-block linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4fs/splice: enhance direct pipe & splice for moving pages in kernelfs/splice.c include/linux/pipe_fs_i.h include/linux/splice.h+47 -011 replies
2/4fs/splice: allow to ignore signal in __splice_from_pipefs/splice.c include/linux/splice.h+3 -20 replies
3/4io_uring: add IORING_OP_READ[WRITE]_SPLICE_BUFinclude/uapi/linux/io_uring.h io_uring/opdef.c io_uring/rw.c +1 more+213 -19 replies
4/4ublk_drv: support splice based read/write zero copydrivers/block/ublk_drv.c include/uapi/linux/ublk_cmd.h+193 -70 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: add IORING_OP_READ[WRITE]_SPLICE_BUF

Hello,

Add two OPs which buffer is retrieved via kernel splice for supporting fuse/ublk zero copy.

The 1st patch enhances direct pipe & splice for moving pages in kernel, so that the two added OPs won't be misused, and avoid potential security hole.

The 2nd patch allows splice_direct_to_actor() caller to ignore signal if the actor won't block and can be done in bound time.

The 3rd patch add the two OPs.

The 4th patch implements ublk's ->splice_read() for supporting zero copy.

ublksrv(userspace):

https://github.com/ming1/ubdsrv/commits/io_uring_splice_buf

So far, only loop/null target implements zero copy in above branch:

ublk add -t loop -f $file -z
ublk add -t none -z

Basic FS/IO function is verified, mount/kernel building & fio works fine, and big chunk IO(BS: 64k/512k) performance gets improved obviously.

Any comment is welcome!

Ming Lei (4):
fs/splice: enhance direct pipe & splice for moving pages in kernel fs/splice: allow to ignore signal in __splice_from_pipe
io_uring: add IORING_OP_READ[WRITE]_SPLICE_BUF
ublk_drv: support splice based read/write zero copy

 drivers/block/ublk_drv.c      | 169 +++++++++++++++++++++++++++++++--
 fs/splice.c                   |  19 +++-
 include/linux/pipe_fs_i.h     |  10 ++
 include/linux/splice.h        |  23 +++++
 include/uapi/linux/io_uring.h |   2 +
 include/uapi/linux/ublk_cmd.h |  31 +++++-
 io_uring/opdef.c              |  37 ++++++++
 io_uring/rw.c                 | 174 +++++++++++++++++++++++++++++++++-
 io_uring/rw.h                 |   1 +
 9 files changed, 456 insertions(+), 10 deletions(-)
Signature · 1 line
2.31.1