diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-02-25 18:17:09 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-25 18:17:09 +0100 |
commit | 4fb6ac326204b3ab81e6e7a914ccd44d957c1d2c (patch) | |
tree | 0462f8ea106520c3426001230a5f858d229bf9ec /fs/io-wq.h | |
parent | io_uring: ensure SQPOLL startup is triggered before error shutdown (diff) | |
download | linux-4fb6ac326204b3ab81e6e7a914ccd44d957c1d2c.tar.xz linux-4fb6ac326204b3ab81e6e7a914ccd44d957c1d2c.zip |
io-wq: improve manager/worker handling over exec
exec will cancel any threads, including the ones that io-wq is using. This
isn't a problem, in fact we'd prefer it to be that way since it means we
know that any async work cancels naturally without having to handle it
proactively.
But it does mean that we need to setup a new manager, as the manager and
workers are gone. Handle this at queue time, and cancel work if we fail.
Since the manager can go away without us noticing, ensure that the manager
itself holds a reference to the 'wq' as well. Rename io_wq_destroy() to
io_wq_put() to reflect that.
In the future we can now simplify exec cancelation handling, for now just
leave it the same.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index 3677b39db015..b6ca12b60c35 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -113,7 +113,7 @@ struct io_wq_data { }; struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data); -void io_wq_destroy(struct io_wq *wq); +void io_wq_put(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); |