summaryrefslogtreecommitdiffstats
path: root/io_uring/sqpoll.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-08-13 11:05:36 -0600
committerJens Axboe <axboe@kernel.dk>2023-08-16 13:40:28 -0600
commitebdfefc09c6de7897962769bd3e63a2ff443ebf5 (patch)
treea70556ba92be56e756410d5e9871c24f1fe1ea24 /io_uring/sqpoll.h
parentd246c759c47eafe4688613e89b337e48c39c5968 (diff)
downloadlinux-ebdfefc09c6de7897962769bd3e63a2ff443ebf5.tar.gz
linux-ebdfefc09c6de7897962769bd3e63a2ff443ebf5.tar.bz2
linux-ebdfefc09c6de7897962769bd3e63a2ff443ebf5.zip
io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used
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>
Diffstat (limited to 'io_uring/sqpoll.h')
-rw-r--r--io_uring/sqpoll.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/sqpoll.h b/io_uring/sqpoll.h
index e1b8d508d22d..8df37e8c9149 100644
--- a/io_uring/sqpoll.h
+++ b/io_uring/sqpoll.h
@@ -27,3 +27,4 @@ void io_sq_thread_park(struct io_sq_data *sqd);
void io_sq_thread_unpark(struct io_sq_data *sqd);
void io_put_sq_data(struct io_sq_data *sqd);
void io_sqpoll_wait_sq(struct io_ring_ctx *ctx);
+int io_sqpoll_wq_cpu_affinity(struct io_ring_ctx *ctx, cpumask_var_t mask);