Skip to content
Commit 8b3e78b5 authored by Jens Axboe's avatar Jens Axboe
Browse files

io-wq: fix races around manager/worker creation and task exit



These races have always been there, they are just more apparent now that
we do early cancel of io-wq when the task exits.

Ensure that the io-wq manager sets task state correctly to not miss
wakeups for task creation. This is important if we get a wakeup after
having marked ourselves as TASK_INTERRUPTIBLE. If we do end up creating
workers, then we flip the state back to running, making the subsequent
schedule() a no-op. Also increment the wq ref count before forking the
thread, to avoid a use-after-free.

Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8a378fb0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment