linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v2 0/3] io_uring: support for linked SQEs
@ 2019-05-29 20:29 Jens Axboe
  2019-05-29 20:29 ` [PATCH 1/3] uio: make import_iovec()/compat_import_iovec() return bytes on success Jens Axboe
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jens Axboe @ 2019-05-29 20:29 UTC (permalink / raw)
  To: linux-fsdevel, linux-block

Here's v2 of the linked SQE patchset. For a full description of this
feature, please refer to the v1 posting:

https://lore.kernel.org/linux-block/20190517214131.5925-1-axboe@kernel.dk/

Changes since v1 are just fixes, and nothing major at that. Some of the
v1 error handling wasn't quite correct, this should be. The liburing
repo contains the link-cp copy implementation using linked SQEs, and
also has a test case that exercises a few of the link combinations.

Patches are against my for-linus branch, but should apply to Linus
master just fine as well.

 block/blk-core.c              |  74 +++++++++-
 block/blk-sysfs.c             |  47 ++----
 block/blk.h                   |   1 +
 drivers/block/loop.c          |  18 +--
 fs/aio.c                      |   9 +-
 fs/block_dev.c                |  25 ++--
 fs/io_uring.c                 | 268 ++++++++++++++++++++++++++--------
 fs/splice.c                   |   8 +-
 include/linux/uio.h           |   4 +-
 include/uapi/linux/io_uring.h |   1 +
 lib/iov_iter.c                |  15 +-
 net/compat.c                  |   3 +-
 net/socket.c                  |   3 +-
 13 files changed, 329 insertions(+), 147 deletions(-)

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCHSET 0/3] io_uring: support for linked SQEs
@ 2019-05-17 21:41 Jens Axboe
  2019-05-17 21:41 ` [PATCH 2/3] io_uring: punt short reads to async context Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2019-05-17 21:41 UTC (permalink / raw)
  To: linux-fsdevel, linux-block; +Cc: viro

We currently support a barrier operation, which ensures that previous
commands have finished before they are executed. This patchset
introduces support for linked commands. Linked commands form a
dependency between commands, but not for the execution pipeline in
general. Example:

[[ ReadA, WriteA], [ReadB, WriteB], [ReadC, WriteC]]

This is a weak ascii attempt at showing a series of reads and writes,
where each write depends on the previous read. WriteA will not be
started before ReadA is complete. Think of a copy like operation, where
ReadA is "read X bytes from file Y at offset Z" and WriteB is then
"write X bytes to file A at offset B", with the two sharing the same
iovec. While WriteA depends on the completion of ReadA, there are no
dependencies between ReadA and ReadB, and they may execute in parallel.

In terms of user API, ReadA will have IOSQE_IO_LINK set. When that is
set, the next command depends on it. If the next one also has
IOSQE_IO_LINK set, then the dependency continues. If it doesn't, then
the chain stops with the next command.

I wrote a trivial cp(2) implementation using linked reads and writes,
you can find that here:

http://git.kernel.dk/cgit/liburing/tree/examples/link-cp.c

in the liburing git repo. There's also a test program in there
exercising various types of chains.

I think this is a very powerful concept, and something that could even
be extended to be BPF driven at completion time if dependencies need
further linkage outside of what can be statically provided initially.
A potential series could be [Open file, Read, Close file] where the
fd needs to be carried forward, for example.

Patches are against current master from Linus, and are also in my
io_uring-next branch.

-- 
Jens Axboe



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

end of thread, other threads:[~2019-05-29 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 20:29 [PATCHSET v2 0/3] io_uring: support for linked SQEs Jens Axboe
2019-05-29 20:29 ` [PATCH 1/3] uio: make import_iovec()/compat_import_iovec() return bytes on success Jens Axboe
2019-05-29 20:29 ` [PATCH 2/3] io_uring: punt short reads to async context Jens Axboe
2019-05-29 20:29 ` [PATCH 3/3] io_uring: add support for sqe links Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2019-05-17 21:41 [PATCHSET 0/3] io_uring: support for linked SQEs Jens Axboe
2019-05-17 21:41 ` [PATCH 2/3] io_uring: punt short reads to async context Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).