io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: [PATCH liburing 1/3] src/queue: don't wait for less than expected
Date: Sun,  7 Feb 2021 23:32:15 +0000	[thread overview]
Message-ID: <eb1de92f946deab354df626a8efff6b9c1a78844.1612740655.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1612740655.git.asml.silence@gmail.com>

__io_uring_peek_cqe() doesn't consume cqe it returns, no need to
decrease wait_nr because we check against the number in CQ as well as
the kernel do. One exception for that behaviour is IOPOLL, but that
kernel will return if there is anything in CQ, so will work just fine.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 src/queue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/queue.c b/src/queue.c
index 94f791e..dd1df2a 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -106,8 +106,6 @@ static int _io_uring_get_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_pt
 			}
 			cq_overflow_flush = true;
 		}
-		if (data->wait_nr && cqe)
-			data->wait_nr--;
 		if (data->wait_nr || cq_overflow_flush)
 			flags = IORING_ENTER_GETEVENTS | data->get_flags;
 		if (data->submit)
-- 
2.24.0


  reply	other threads:[~2021-02-07 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 23:32 [PATCH liburing 0/3] fix _io_uring_get_cqe() Pavel Begunkov
2021-02-07 23:32 ` Pavel Begunkov [this message]
2021-02-07 23:32 ` [PATCH liburing 2/3] src/queue: clean _io_uring_get_cqe() err handling Pavel Begunkov
2021-02-07 23:32 ` [PATCH liburing 3/3] src/queue: don't loop when don't enter Pavel Begunkov
2021-02-08 15:26 ` [PATCH liburing 0/3] fix _io_uring_get_cqe() 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=eb1de92f946deab354df626a8efff6b9c1a78844.1612740655.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).