]> git.hungrycats.org Git - linux/commit
io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used
authorJens Axboe <axboe@kernel.dk>
Sun, 13 Aug 2023 17:05:36 +0000 (11:05 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:39 +0000 (09:48 +0200)
commit63059d272c4c70dff5f14caf49b245ae056f86cf
treea74cb69dfdc7c72aeeb24998e56f6af0d1b33c3f
parente64db62650d41c06290136e60c1f822821cb51e4
io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used

commit ebdfefc09c6de7897962769bd3e63a2ff443ebf5 upstream.

If we setup the ring with SQPOLL, then that polling thread has its
own io-wq setup. This means that if the application uses
IORING_REGISTER_IOWQ_AFF to set the io-wq affinity, we should not be
setting it for the invoking task, but rather the sqpoll task.

Add an sqpoll helper that parks the thread and updates the affinity,
and use that one if we're using SQPOLL.

Fixes: fe76421d1da1 ("io_uring: allow user configurable IO thread CPU affinity")
Cc: stable@vger.kernel.org # 5.10+
Link: https://github.com/axboe/liburing/discussions/884
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io-wq.c
io_uring/io-wq.h
io_uring/io_uring.c
io_uring/sqpoll.c
io_uring/sqpoll.h