summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-08-21 15:21:19 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-23 21:10:47 +0200
commit2c5d763c1939fbd130452ee0d4d1a44b5dd97bb7 (patch)
treec70ec332bf0fcb42169909bdeb113f797187ec25 /fs/io_uring.c
parentio_uring: place fixed tables under memcg limits (diff)
downloadlinux-2c5d763c1939fbd130452ee0d4d1a44b5dd97bb7.tar.xz
linux-2c5d763c1939fbd130452ee0d4d1a44b5dd97bb7.zip
io_uring: add clarifying comment for io_cqring_ev_posted()
We've previously had an issue where overflow flush unconditionally calls io_cqring_ev_posted() even if it didn't flush any events to the ring, causing wake and eventfd increment where no new events are available. Some applications don't like that, see commit b18032bb0a88 for details. This came up in discussion for another patch recently, hence add a comment detailing what the relationship between calling the events posted helper and CQ ring entries is. Link: https://lore.kernel.org/io-uring/77a44fce-c831-16a6-8e80-9aee77f496a2@kernel.dk/ Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index c6f1afa5ec04..8d263209b508 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1526,6 +1526,13 @@ static inline bool io_should_trigger_evfd(struct io_ring_ctx *ctx)
return !ctx->eventfd_async || io_wq_current_is_worker();
}
+/*
+ * This should only get called when at least one event has been posted.
+ * Some applications rely on the eventfd notification count only changing
+ * IFF a new CQE has been added to the CQ ring. There's no depedency on
+ * 1:1 relationship between how many times this function is called (and
+ * hence the eventfd count) and number of CQEs posted to the CQ ring.
+ */
static void io_cqring_ev_posted(struct io_ring_ctx *ctx)
{
/*