]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: spin for sq thread to idle on shutdown
authorJens Axboe <axboe@kernel.dk>
Tue, 4 Feb 2020 23:48:34 +0000 (16:48 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Feb 2020 23:48:34 +0000 (16:48 -0700)
commita5803e8f947afff78bafbd06df00272bb9da9b1f
tree714dcb977224e28c8f08af8ed9db505f2226c915
parenteb1220a92f86709e8dfb8f4f186e2a126214075f
io_uring: spin for sq thread to idle on shutdown

As part of io_uring shutdown, we cancel work that is pending and won't
necessarily complete on its own. That includes requests like poll
commands and timeouts.

If we're using SQPOLL for kernel side submission and we shutdown the
ring immediately after queueing such work, we can race with the sqthread
doing the submission. This means we may miss cancelling some work, which
results in the io_uring shutdown hanging forever.

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