io_uring: remove need for sqd->ctx_lock in io_sq_thread()
authorJens Axboe <axboe@kernel.dk>
Thu, 3 Sep 2020 15:25:12 +0000 (09:25 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 5 Sep 2020 22:07:36 +0000 (16:07 -0600)
commit6a7bb9ff57449ac6a6350f56af6ebb4e08bebf5d
tree84ad4139ca47f7936fc119bcd066a00929ca743e
parentfc24d385fce817abd1593d10b0d3df38b918f82f
io_uring: remove need for sqd->ctx_lock in io_sq_thread()

We have two things we need to synchronize against for the sqd ctx lists:

1) Additions/deletions on the list between users and the thread. We now
   handle that through parking the thread before we manipulate the list,
   eliminating the need for the SQPOLL thread to continually grab and
   release the mutex.

2) Multiple rings manipulating the list. We retain the sqd->ctx_lock to
   synchronize between users adding or removing entries.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c