summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-05-17 13:27:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-04 14:42:18 +0200
commitc844ace5b88d0e7e5ae804ca5d92603deb1bc792 (patch)
tree1399e44f404d6133ad2d0de167343a7b1e34b5c7 /io_uring
parentdbcd0909a1e2cdecd5abc3e6529c5cfa7d712d52 (diff)
downloadlinux-c844ace5b88d0e7e5ae804ca5d92603deb1bc792.tar.gz
linux-c844ace5b88d0e7e5ae804ca5d92603deb1bc792.tar.bz2
linux-c844ace5b88d0e7e5ae804ca5d92603deb1bc792.zip
io_uring: fix overflow resched cqe reordering
[ Upstream commit a7d755ed9ce9738af3db602eb29d32774a180bc7 ] Leaving the CQ critical section in the middle of a overflow flushing can cause cqe reordering since the cache cq pointers are reset and any new cqe emitters that might get called in between are not going to be forced into io_cqe_cache_refill(). Fixes: eac2ca2d682f9 ("io_uring: check if we need to reschedule during overflow flush") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/90ba817f1a458f091f355f407de1c911d2b93bbf.1747483784.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index db592fa549b7..43b46098279a 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -701,6 +701,7 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx)
* to care for a non-real case.
*/
if (need_resched()) {
+ ctx->cqe_sentinel = ctx->cqe_cached;
io_cq_unlock_post(ctx);
mutex_unlock(&ctx->uring_lock);
cond_resched();