io_uring: add io-wq workqueue sharing for-5.6/io_uring-vfs-wq
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 28 Jan 2020 00:15:48 +0000 (03:15 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jan 2020 00:26:50 +0000 (17:26 -0700)
commit6796f83cfb86610670a583bd19177fbbaa28c7ca
tree73c40991fdeecd76619d029d33a240ced1358a8c
parent25bd2c4cd40ab24b1b22606f4b8e064e372fc085
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