summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-08-09 21:58:59 +0300
committerJens Axboe <axboe@kernel.dk>2023-08-11 19:36:12 +0300
commit78848b9b05623cfddb790d23b0dc38a275eb0763 (patch)
tree6098c9b1068cc1ac8545c2a822da90ab1d5f50eb /io_uring
parent89226307b109f828566f0e024ee97b722167927c (diff)
downloadlinux-78848b9b05623cfddb790d23b0dc38a275eb0763.tar.xz
io_uring/io-wq: don't grab wq->lock for worker activation
The worker free list is RCU protected, and checks for workers going away when iterating it. There's no need to hold the wq->lock around the lookup. Reviewed-by: Hao Xu <howeyxu@tencent.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io-wq.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 399e9a15c38d..3e7025b9e0dd 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -909,13 +909,10 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
clear_bit(IO_ACCT_STALLED_BIT, &acct->flags);
raw_spin_unlock(&acct->lock);
- raw_spin_lock(&wq->lock);
rcu_read_lock();
do_create = !io_wq_activate_free_worker(wq, acct);
rcu_read_unlock();
- raw_spin_unlock(&wq->lock);
-
if (do_create && ((work_flags & IO_WQ_WORK_CONCURRENT) ||
!atomic_read(&acct->nr_running))) {
bool did_create;