summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-26 19:52:02 +0300
committerJens Axboe <axboe@kernel.dk>2021-03-04 16:32:53 +0300
commit613eeb600e3e636a1d3b3711dddaf2b134d5a32c (patch)
tree5d8ab227be83213d56d457b392f9c9539e8d8fad /fs
parentfb3a1f6c745ccd896afadf6e2d6f073e871d38ba (diff)
downloadlinux-613eeb600e3e636a1d3b3711dddaf2b134d5a32c.tar.xz
io-wq: don't ask for a new worker if we're exiting
If we're in the process of shutting down the async context, then don't create new workers if we already have at least the fixed one. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io-wq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 1d01edada8aa..2f9d7ee12ee1 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -673,6 +673,8 @@ static inline bool io_wqe_need_worker(struct io_wqe *wqe, int index)
{
struct io_wqe_acct *acct = &wqe->acct[index];
+ if (acct->nr_workers && test_bit(IO_WQ_BIT_EXIT, &wqe->wq->state))
+ return false;
/* if we have available workers or no work, no need */
if (!hlist_nulls_empty(&wqe->free_list) || !io_wqe_run_queue(wqe))
return false;