Commit 3adfecaa authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

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: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6795c5ab
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
		}