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-wq.h | |
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-wq.h')
-rw-r--r-- | fs/io-wq.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index b6ca12b60c35..f6ef433df8a8 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -114,6 +114,7 @@ struct io_wq_data { struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data); void io_wq_put(struct io_wq *wq); +void io_wq_put_and_exit(struct io_wq *wq); void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work); void io_wq_hash_work(struct io_wq_work *work, void *val); |