]> git.baikalelectronics.ru Git - kernel.git/commit
io-wq: provide an io_wq_put_and_exit() helper
authorJens Axboe <axboe@kernel.dk>
Fri, 26 Feb 2021 20:48:19 +0000 (13:48 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Mar 2021 13:34:39 +0000 (06:34 -0700)
commit1f2de4f3ba3c95962283a5f0c300776bd261bda4
tree107b0e65a3d2e5218cd1967b71f3e07d38856839
parent072086f6d78a8859d6c726cc2957eb2a1d498684
io-wq: provide an io_wq_put_and_exit() helper

If we put the io-wq from io_uring, we really want it to exit. Provide
a helper that does that for us. Couple that with not having the manager
hold a reference to the 'wq' and the normal SQPOLL exit will tear down
the io-wq context appropriate.

On the io-wq side, our wq context is per task, so only the task itself
is manipulating ->manager and hence it's safe to check and clear without
any extra locking. We just need to ensure that the manager task stays
around, in case it exits.

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