Skip to content

Commit 74a37ce

Browse files
isilencegregkh
authored andcommitted
io_uring: fix waiters missing wake ups
There are reports of mariadb hangs, which is caused by a missing barrier in the waking code resulting in waiters losing events. The problem was introduced in a backport 3ab9326 ("io_uring: wake up optimisations"), and the change restores the barrier present in the original commit 3ab9326 ("io_uring: wake up optimisations") Reported by: Xan Charbonnet <[email protected]> Fixes: 3ab9326 ("io_uring: wake up optimisations") Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093243#99 Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2a40a14 commit 74a37ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io_uring/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,10 @@ static inline void __io_cq_unlock_post_flush(struct io_ring_ctx *ctx)
597597
io_commit_cqring(ctx);
598598
spin_unlock(&ctx->completion_lock);
599599
io_commit_cqring_flush(ctx);
600-
if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))
600+
if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN)) {
601+
smp_mb();
601602
__io_cqring_wake(ctx);
603+
}
602604
}
603605

604606
void io_cq_unlock_post(struct io_ring_ctx *ctx)

0 commit comments

Comments
 (0)