From: Ankit Kumar <ankit.kumar@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, vincentfu@gmail.com,
Ankit Kumar <ankit.kumar@samsung.com>
Subject: [PATCH 1/1] engines/io_uring: set coop taskrun, single issuer and defer taskrun
Date: Tue, 11 Oct 2022 16:29:35 +0530 [thread overview]
Message-ID: <20221011105935.10455-2-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20221011105935.10455-1-ankit.kumar@samsung.com>
Add missing changes to io_uring_cmd I/O engine for COOP_TASKRUN
This was introduced for io_uring in commit 4d22c103
Add missing changes to io_uring_cmd I/O engine to set single issuer
and defer taskrun. This was introduced for io_uring in commit e453f369
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
engines/io_uring.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/engines/io_uring.c b/engines/io_uring.c
index c679177f..6906e0a4 100644
--- a/engines/io_uring.c
+++ b/engines/io_uring.c
@@ -889,9 +889,30 @@ static int fio_ioring_cmd_queue_init(struct thread_data *td)
p.flags |= IORING_SETUP_CQSIZE;
p.cq_entries = depth;
+ /*
+ * Setup COOP_TASKRUN as we don't need to get IPI interrupted for
+ * completing IO operations.
+ */
+ p.flags |= IORING_SETUP_COOP_TASKRUN;
+
+ /*
+ * io_uring is always a single issuer, and we can defer task_work
+ * runs until we reap events.
+ */
+ p.flags |= IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN;
+
retry:
ret = syscall(__NR_io_uring_setup, depth, &p);
if (ret < 0) {
+ if (errno == EINVAL && p.flags & IORING_SETUP_DEFER_TASKRUN) {
+ p.flags &= ~IORING_SETUP_DEFER_TASKRUN;
+ p.flags &= ~IORING_SETUP_SINGLE_ISSUER;
+ goto retry;
+ }
+ if (errno == EINVAL && p.flags & IORING_SETUP_COOP_TASKRUN) {
+ p.flags &= ~IORING_SETUP_COOP_TASKRUN;
+ goto retry;
+ }
if (errno == EINVAL && p.flags & IORING_SETUP_CQSIZE) {
p.flags &= ~IORING_SETUP_CQSIZE;
goto retry;
--
2.17.1
next prev parent reply other threads:[~2022-10-12 5:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20221011110947epcas5p2f840397a3e45e1d9326619a10d52ffa3@epcas5p2.samsung.com>
2022-10-11 10:59 ` [PATCH 0/1] Add missing flags to the uring passthrough engine Ankit Kumar
[not found] ` <CGME20221011110948epcas5p1a129c0869d780bf1b236141d18e8023f@epcas5p1.samsung.com>
2022-10-11 10:59 ` Ankit Kumar [this message]
2022-10-12 13:19 ` Jens Axboe
2022-10-14 5:32 ` Ankit Kumar
2022-10-14 12:13 ` 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=20221011105935.10455-2-ankit.kumar@samsung.com \
--to=ankit.kumar@samsung.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincentfu@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.