]> 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)
commitdee631de822ec1ab45a6905471447ebdb17c9c02
tree91c6a251a711dc36541b2d50560188bc73c72e83
parentca7c3e3805b61ff1d9466b19c8eb7d673bb4a893
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: 39a942a12885 ("io_uring: SQPOLL stop error handling fixes")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c