public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 2/2] io_uring: prolong tctx_task_work() with flushing
Date: Thu,  2 Sep 2021 00:38:23 +0100	[thread overview]
Message-ID: <0755d4c2c36301447c63bdd4146c10477cea4249.1630539342.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 14b074575eb6..2bde732a1183 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);
-- 
2.33.0


  parent reply	other threads:[~2021-09-01 23:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 23:38 [PATCH 0/2] small optimisations Pavel Begunkov
2021-09-01 23:38 ` [PATCH 1/2] io_uring: don't disable kiocb_done() CQE batching Pavel Begunkov
2021-09-01 23:38 ` Pavel Begunkov [this message]
2021-09-02  2:41 ` [PATCH 0/2] small optimisations Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0755d4c2c36301447c63bdd4146c10477cea4249.1630539342.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox