summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-06-28 12:52:37 +0300
committerJens Axboe <axboe@kernel.dk>2020-06-28 08:13:03 -0600
commit3adfecaa647ff8afa4b6f5907193cf751a0f8351 (patch)
tree7cd4a32d63714290fe17cb498f437979006c1121 /fs/io_uring.c
parent6795c5aba247653f99d1f336ff496dd74659b322 (diff)
downloadlwn-3adfecaa647ff8afa4b6f5907193cf751a0f8351.tar.gz
lwn-3adfecaa647ff8afa4b6f5907193cf751a0f8351.zip
io_uring: do task_work_run() during iopoll
There are a lot of new users of task_work, and some of task_work_add() may happen while we do io polling, thus make iopoll from time to time to do task_work_run(), so it doesn't poll for sitting there reqs. Signed-off-by: Pavel Begunkov <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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index f283d111666b..c514a5209703 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2052,6 +2052,8 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, unsigned *nr_events,
*/
if (!(++iters & 7)) {
mutex_unlock(&ctx->uring_lock);
+ if (current->task_works)
+ task_work_run();
mutex_lock(&ctx->uring_lock);
}