public inbox for [email protected]
 help / color / mirror / Atom feed
From: [email protected]
To: [email protected]
Cc: Liming Wu <[email protected]>
Subject: [PATCH] io_uring:IORING_SETUP_SQPOLL don't need to enter io_cqring_wait
Date: Tue,  7 Apr 2020 16:44:35 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

From: Liming Wu <[email protected]>

When SETUP_IOPOLL and SETUP_SQPOLL are both enabled, app don't
need to enter io_cqring_wait too. If I misunderstand, please give
me some advise.

Signed-off-by Liming Wu <[email protected]>
---
 io_uring.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/io_uring.c b/io_uring.c
index b12d33b..36e884f 100644
--- a/io_uring.c
+++ b/io_uring.c
@@ -7418,11 +7418,12 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
 		 * polling again, they can rely on io_sq_thread to do polling
 		 * work, which can reduce cpu usage and uring_lock contention.
 		 */
-		if (ctx->flags & IORING_SETUP_IOPOLL &&
-		    !(ctx->flags & IORING_SETUP_SQPOLL)) {
-			ret = io_iopoll_check(ctx, &nr_events, min_complete);
-		} else {
-			ret = io_cqring_wait(ctx, min_complete, sig, sigsz);
+		if (!(ctx->flags & IORING_SETUP_SQPOLL)) {
+		    if (ctx->flags & IORING_SETUP_IOPOLL) {
+		    	ret = io_iopoll_check(ctx, &nr_events, min_complete);
+		    } else {
+		    	ret = io_cqring_wait(ctx, min_complete, sig, sigsz);
+		    }
 		}
 	}
 
-- 
1.8.3.1


             reply	other threads:[~2020-04-07  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07  8:44 wu860403 [this message]
2020-04-07 22:04 ` [PATCH] io_uring:IORING_SETUP_SQPOLL don't need to enter io_cqring_wait Jens Axboe
2020-04-08  5:30   ` Xiaoguang Wang
2020-04-08  5:43 ` Xiaoguang Wang

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=1586249075-14649-1-git-send-email-wu860403@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