From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH] io_uring: avoid iowq again trap
Date: Fri, 13 May 2022 11:24:56 +0100 [thread overview]
Message-ID: <f168b4f24181942f3614dd8ff648221736f572e6.1652433740.git.asml.silence@gmail.com> (raw)
If an opcode handler semi-reliably returns -EAGAIN, io_wq_submit_work()
might continue busily hammer the same handler over and over again, which
is not ideal. The -EAGAIN handling in question was put there only for
IOPOLL, so restrict it to IOPOLL mode only.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index e01f595f5b7d..3af1905efc78 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7319,6 +7319,8 @@ static void io_wq_submit_work(struct io_wq_work *work)
* wait for request slots on the block side.
*/
if (!needs_poll) {
+ if (!(req->ctx->flags & IORING_SETUP_IOPOLL))
+ break;
cond_resched();
continue;
}
--
2.36.0
next reply other threads:[~2022-05-13 10:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 10:24 Pavel Begunkov [this message]
2022-05-13 12:31 ` [PATCH] io_uring: avoid iowq again trap Jens Axboe
2022-05-13 12:49 ` Pavel Begunkov
2022-05-13 12:50 ` Jens Axboe
2022-05-13 12:51 ` Jens Axboe
2022-05-15 7:31 ` Hao Xu
2022-05-15 14:21 ` Pavel Begunkov
2022-05-15 15:07 ` Hao Xu
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=f168b4f24181942f3614dd8ff648221736f572e6.1652433740.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