public inbox for [email protected]
 help / color / mirror / Atom feed
From: Bijan Mottahedeh <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH liburing 2/3] update wait_nr to account for completed event
Date: Tue, 19 May 2020 14:52:20 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

If there are events to wait for, then account for one already complete.

Signed-off-by: Bijan Mottahedeh <[email protected]>
---
 src/queue.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/queue.c b/src/queue.c
index c7473c0..da2f405 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -49,6 +49,8 @@ int __io_uring_get_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_ptr,
 			err = -EAGAIN;
 			break;
 		}
+		if (wait_nr && cqe)
+			wait_nr--;
 		if (wait_nr)
 			flags = IORING_ENTER_GETEVENTS;
 		if (submit)
-- 
1.8.3.1


  parent reply	other threads:[~2020-05-19 21:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 21:52 [PATCH liburing 0/3] __io_uring_get_cqe() fix/optimization Bijan Mottahedeh
2020-05-19 21:52 ` [PATCH liburing 1/3] preseve wait_nr if SETUP_IOPOLL is set Bijan Mottahedeh
2020-05-19 21:52 ` Bijan Mottahedeh [this message]
2020-05-19 21:52 ` [PATCH liburing 3/3] remove duplicate call to __io_uring_peek_cqe() Bijan Mottahedeh
2020-05-19 22:12 ` [PATCH liburing 0/3] __io_uring_get_cqe() fix/optimization 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=1589925141-48552-3-git-send-email-bijan.mottahedeh@oracle.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