Skip to content

RFC support nonblock submission for splice pipe to pipe

Hao Xu io-uring linux-fsdevel linux-mm llvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5io_uring: move sp->len check up for splice and teeio_uring/splice.c+8 -40 replies
2/5pipe: add trylock helpers for pipe lockfs/pipe.c include/linux/pipe_fs_i.h+31 -00 replies
3/5splice: support nonblock for splice from pipe to pipefs/splice.c+18 -30 replies
4/5io_uring: support nonblock try for splicing from pipe to pipeio_uring/splice.c+21 -30 replies
5/5io_uring: add file_in in io_splice{} to avoid duplicate calculationio_uring/splice.c+19 -140 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/5] support nonblock submission for splice pipe to pipe

From: Hao Xu <[email protected]>

splice from pipe to pipe is a trivial case, and we can support nonblock try for it easily. splice depends on iowq at all which is slow. Let's build a fast submission path for it by supporting nonblock.

Wrote a simple test to test time spent of splicing from pipe to pipe:

Did 50 times test for each, ignore the highest and lowest number, calculate the average number:

before patchset: 119.85 usec
with patchset: 29.5 usec

----------------
I'm not sure if we should use a io_uring specific flag rather than SPLICE_F_NONBLOCK since from mutex_lock_nest to mutex_trylock changes the behavior under debug environment I guess. Or maybe there is another better option than mutex_trylock?

Hao Xu (5):
io_uring: move sp->len check up for splice and tee
pipe: add trylock helpers for pipe lock
splice: support nonblock for splice from pipe to pipe
io_uring: support nonblock try for splicing from pipe to pipe
io_uring: add file_in in io_splice{} to avoid duplicate calculation

 fs/pipe.c                 | 29 +++++++++++++++++++++
 fs/splice.c               | 21 +++++++++++++---
 include/linux/pipe_fs_i.h |  2 ++
 io_uring/splice.c         | 53 +++++++++++++++++++++++++++++----------
 4 files changed, 89 insertions(+), 16 deletions(-)

base-commit: d8271bf021438f468dab3cd84fe5279b5bbcead8

Signature · 1 line
2.25.1