io_uring: add io-wq workqueue sharing
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 28 Jan 2020 00:15:48 +0000 (03:15 +0300)
committerJens Axboe <axboe@kernel.dk>
Wed, 29 Jan 2020 00:44:41 +0000 (17:44 -0700)
commit24369c2e3bb06d8c4e71fd6ceaf4f8a01ae79b7c
tree85a855b36b34647dd7b360635f2535545294afd8
parenteba6f5a330cf042bb0001f0b5e8cbf21be1b25d6
io_uring: add io-wq workqueue sharing

If IORING_SETUP_ATTACH_WQ is set, it expects wq_fd in io_uring_params to
be a valid io_uring fd io-wq of which will be shared with the newly
created io_uring instance. If the flag is set but it can't share io-wq,
it fails.

This allows creation of "sibling" io_urings, where we prefer to keep the
SQ/CQ private, but want to share the async backend to minimize the amount
of overhead associated with having multiple rings that belong to the same
backend.

Reported-by: Jens Axboe <axboe@kernel.dk>
Reported-by: Daurnimator <quae@daurnimator.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h