Skip to content

Commit a7d755e

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix overflow resched cqe reordering
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: eac2ca2 ("io_uring: check if we need to reschedule during overflow flush") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/90ba817f1a458f091f355f407de1c911d2b93bbf.1747483784.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent f1774d9 commit a7d755e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)
636636
* to care for a non-real case.
637637
*/
638638
if (need_resched()) {
639+
ctx->cqe_sentinel = ctx->cqe_cached;
639640
io_cq_unlock_post(ctx);
640641
mutex_unlock(&ctx->uring_lock);
641642
cond_resched();

0 commit comments

Comments
 (0)