io_uring: add support for bundles
authorJens Axboe <axboe@kernel.dk>
Tue, 22 Nov 2022 19:27:56 +0000 (12:27 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Jan 2023 20:45:32 +0000 (13:45 -0700)
commit2f3a7d309a69f171c4cd83b37ea1099f0548ecaa
tree2572a90eda8ef07888ccbf340101d4c4d4e61f6d
parent05244b441ac78c0474ae509c096a9a72acb3581c
io_uring: add support for bundles

This adds a new command type, IORING_OP_BUNDLE. Such a request must have
a link flag set, and a submission can have any number of linked request
submitted. Each linked request will be part of the bundle, and a bundle
will terminate when the link flag is no longer set. This works just like
regular links.

The difference is that a bundle request completes when ALL the requests
in a bundle have completed, and each request in the bundle can be issued
in parallel. Unlike regular links, there are no dependencies between
the individual requests in a bundle.

If used with CQE supression (setting IOSQE_CQE_SKIP_SUCCESS in the SQE),
a bundle will only generate a single CQE - for the bundle itself. If
any of the bundled requests error, they will post a completion as per
usual with IOSQE_CQE_SKIP_SUCCESS.

The IORING_OP_BUNDLE completion is either < 0 for an error, or the
number of bundle members that completed (0, if the submitted bundle
was empty).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
include/uapi/linux/io_uring.h
io_uring/Makefile
io_uring/bundle.c [new file with mode: 0644]
io_uring/bundle.h [new file with mode: 0644]
io_uring/io_uring.c
io_uring/opdef.c