diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-02-26 21:48:19 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-03-04 14:34:39 +0100 |
commit | afcc4015d1bf5659b8c722aff679e9b8c41ee156 (patch) | |
tree | 107b0e65a3d2e5218cd1967b71f3e07d38856839 /fs/io_uring.c | |
parent | io_uring: don't use complete_all() on SQPOLL thread exit (diff) | |
download | linux-afcc4015d1bf5659b8c722aff679e9b8c41ee156.tar.xz linux-afcc4015d1bf5659b8c722aff679e9b8c41ee156.zip |
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>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 904bf0fecc36..cb65e54c1b09 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8857,7 +8857,7 @@ void __io_uring_files_cancel(struct files_struct *files) if (files) { io_uring_remove_task_files(tctx); if (tctx->io_wq) { - io_wq_put(tctx->io_wq); + io_wq_put_and_exit(tctx->io_wq); tctx->io_wq = NULL; } } |