From: Pavel Begunkov Date: Wed, 1 Sep 2021 23:38:23 +0000 (+0100) Subject: io_uring: prolong tctx_task_work() with flushing X-Git-Tag: accepted/tizen/unified/20230118.172025~6453^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d4ad41e3e8e4b907f088f25aee4a92f3f864027;p=platform%2Fkernel%2Flinux-rpi.git io_uring: prolong tctx_task_work() with flushing io_submit_flush_completions() may enqueue linked requests for task_work execution, so don't leave tctx_task_work() right after the tw list is exhausted, but try to flush and then retry. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0755d4c2c36301447c63bdd4146c10477cea4249.1630539342.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 9f3f8a8..3a7145a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2102,6 +2102,9 @@ static void tctx_task_work(struct callback_head *cb) while (1) { struct io_wq_work_node *node; + if (!tctx->task_list.first && locked && ctx->submit_state.compl_nr) + io_submit_flush_completions(ctx); + spin_lock_irq(&tctx->task_lock); node = tctx->task_list.first; INIT_WQ_LIST(&tctx->task_list);