IO-Uring Archive on
 help / color / Atom feed
* [PATCH] io_uring: fix accounting of dropped CQEs in backlog flush
@ 2019-11-09 14:20 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2019-11-09 14:20 UTC (permalink / raw)
  To: io-uring; +Cc: Pavel Begunkov

We really should increment the overflow count if we drop events from
the overflow backlog, even if we only do this from the path where
either the task or the ring is going way.

Fixes: c28f37817b7c ("io_uring: add support for backlogged CQ ring")
Reported-by: Pavel Begunkov <>
Signed-off-by: Jens Axboe <>


diff --git a/fs/io_uring.c b/fs/io_uring.c
index 321ccc38397c..f2769f5f9662 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -628,6 +628,9 @@ static void io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force)
 			WRITE_ONCE(cqe->user_data, req->user_data);
 			WRITE_ONCE(cqe->res, req->result);
 			WRITE_ONCE(cqe->flags, 0);
+		} else {
+			WRITE_ONCE(ctx->rings->cq_overflow,
+				atomic_inc_return(&ctx->cached_cq_overflow));
Jens Axboe

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09 14:20 [PATCH] io_uring: fix accounting of dropped CQEs in backlog flush Jens Axboe

IO-Uring Archive on

Archives are clonable:
	git clone --mirror io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ \
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone