summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-02-07 23:32:15 +0000
committerJens Axboe <axboe@kernel.dk>2021-02-08 08:25:57 -0700
commitc2aea7b748d93d627be32f240d263cc9a795ddc5 (patch)
tree28664186ee36f750141b1a387ed7d021492ee96a
parentccfe96eb3dca697e58f1dc42f82fb79f01a948b1 (diff)
downloadliburing-c2aea7b748d93d627be32f240d263cc9a795ddc5.tar.gz
liburing-c2aea7b748d93d627be32f240d263cc9a795ddc5.tar.bz2
src/queue: don't wait for less than expected
__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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/queue.c2
1 files changed, 0 insertions, 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)