]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: SQPOLL parking fixes
authorJens Axboe <axboe@kernel.dk>
Sat, 6 Mar 2021 20:58:48 +0000 (13:58 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Mar 2021 14:28:22 +0000 (07:28 -0700)
commit8cfcafe08cc839c93fb4b3388f493b2d03c91c5b
tree91c6a251a711dc36541b2d50560188bc73c72e83
parent68c57ecbc54702d7610f015254d0aec9d43f9d2d
io_uring: SQPOLL parking fixes

We keep running into weird dependency issues between the sqd lock and
the parking state. Disentangle the SQPOLL thread from the last bits of
the kthread parking inheritance, and just replace the parking state,
and two associated locks, with a single rw mutex. The SQPOLL thread
keeps the mutex for read all the time, except if someone has marked us
needing to park. Then we drop/re-acquire and try again.

This greatly simplifies the parking state machine (by just getting rid
of it), and makes it a lot more obvious how it works - if you need to
modify the ctx list, then you simply park the thread which will grab
the lock for writing.

Fold in fix from Hillf Danton on not setting STOP on a fatal signal.

Fixes: f42da8fefe9d ("io_uring: SQPOLL stop error handling fixes")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c