Skip to content

Commit 78848b9

Browse files
committed
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>
1 parent 8922630 commit 78848b9

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

io_uring/io-wq.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,10 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
909909
clear_bit(IO_ACCT_STALLED_BIT, &acct->flags);
910910
raw_spin_unlock(&acct->lock);
911911

912-
raw_spin_lock(&wq->lock);
913912
rcu_read_lock();
914913
do_create = !io_wq_activate_free_worker(wq, acct);
915914
rcu_read_unlock();
916915

917-
raw_spin_unlock(&wq->lock);
918-
919916
if (do_create && ((work_flags & IO_WQ_WORK_CONCURRENT) ||
920917
!atomic_read(&acct->nr_running))) {
921918
bool did_create;

0 commit comments

Comments
 (0)