Skip to contentSkip to conversation

Add missing flags to the uring passthrough engine

PATCH Applied Ankit Kumar 2 participants 5 messages Oct 12, 2022 – Oct 14, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20221011110947epcas5p2f840397a3e45e1d9326619a10d52ffa3@epcas5p2.samsung.com

#1 lore raw

cover Add missing flags to the uring passthrough engine

Add flag IORING_SETUP_COOP_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit 4d22c103

Add flag IORING_SETUP_SINGLE_ISSUER & IORING_SETUP_DEFER_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit e453f369

Ankit Kumar (1):
engines/io_uring: set coop taskrun, single issuer and defer taskrun

 engines/io_uring.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 engines/io_uring: set coop taskrun, single issuer and defer taskrun

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

---
 engines/io_uring.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
engines/io_uring.c +21 -0
index c679177f..6906e0a4 100644
@@ -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;
Signature · 1 line
2.17.1
Applied
#3 lore raw
In reply to Ankit Kumar
Quoted 9 lines · Ankit Kumar

Add flag IORING_SETUP_COOP_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit 4d22c103

Add flag IORING_SETUP_SINGLE_ISSUER & IORING_SETUP_DEFER_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit e453f369

[...]

Applied, thanks!

[1/1] engines/io_uring: set coop taskrun, single issuer and defer taskrun

      commit: 07f78c37833730594778fb5684ac6ec40d0289f8

Best regards,

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Ankit Kumar

Add flag IORING_SETUP_COOP_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit 4d22c103

Add flag IORING_SETUP_SINGLE_ISSUER & IORING_SETUP_DEFER_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit e453f369

Quoted 10 lines
Quoted 1 line

[...]

Applied, thanks!

[1/1] engines/io_uring: set coop taskrun, single issuer and defer taskrun

      commit: 07f78c37833730594778fb5684ac6ec40d0289f8

Best regards,

Signature · 1 line
Jens Axboe

Hi Jens,

I don't see the commit in the master branch.
Can you please take a look.

Thanks and Regards
Ankit

Quoted 3 lines
#5 lore raw
Quoted 17 lines · Ankit Kumar
Quoted 16 lines · Jens Axboe
Quoted 9 lines · Ankit Kumar

Add flag IORING_SETUP_COOP_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit 4d22c103

Add flag IORING_SETUP_SINGLE_ISSUER & IORING_SETUP_DEFER_TASKRUN for ring setup, to the uring passthrough I/O engine. This was introduced to the normal io_uring engine with commit e453f369

[...]

Applied, thanks!

[1/1] engines/io_uring: set coop taskrun, single issuer and defer taskrun

      commit: 07f78c37833730594778fb5684ac6ec40d0289f8
Quoted 8 lines
Quoted 3 lines

Best regards,

Signature · 1 line
Jens Axboe

Hi Jens,

I don't see the commit in the master branch.
Can you please take a look.

Guess it might help if I actually pushed it out after committing, that has been done now.

Signature · 1 line
Jens Axboe