summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-09-24 22:00:04 +0100
committerJens Axboe <axboe@kernel.dk>2021-10-19 05:49:54 -0600
commit5e371265ea1d3e0cd02236b1a6d79fe322523ae8 (patch)
tree9adb84bd783f714d7aa3c8465123ef9a6aba9745 /fs/io_uring.c
parenta1cdbb4cb5f7190c429b1127892f756b7cd32db4 (diff)
downloadlwn-5e371265ea1d3e0cd02236b1a6d79fe322523ae8.tar.gz
lwn-5e371265ea1d3e0cd02236b1a6d79fe322523ae8.zip
io_uring: disable draining earlier
Clear ->drain_active in two more cases where we check for a need of draining. It's not a bug, but still may lead to some extra requests being punted to io-wq, and that may be not desirable. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/d20b265f77bb4e8860b15b9987252c7c711dfcba.1632516769.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5a06063d5d81..fd3dc6432a34 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6461,8 +6461,10 @@ static bool io_drain_req(struct io_kiocb *req)
seq = io_get_sequence(req);
/* Still a chance to pass the sequence check */
- if (!req_need_defer(req, seq) && list_empty_careful(&ctx->defer_list))
+ if (!req_need_defer(req, seq) && list_empty_careful(&ctx->defer_list)) {
+ ctx->drain_active = false;
return false;
+ }
ret = io_req_prep_async(req);
if (ret)
@@ -6481,6 +6483,7 @@ fail:
spin_unlock(&ctx->completion_lock);
kfree(de);
io_queue_async_work(req, NULL);
+ ctx->drain_active = false;
return true;
}