diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2 index 9742fda6e..f0aebdece 100644 --- a/man/io_uring_setup.2 +++ b/man/io_uring_setup.2 @@ -97,11 +97,14 @@ call with the following code sequence: .in +4n .EX /* - * Ensure that the wakeup flag is read after the tail pointer has been - * written. + * Ensure that the wakeup flag is read after the tail pointer + * has been written. It's important to use memory load acquire + * semantics for the flags read, as otherwise the application + * and the kernel might not agree on the consistency of the + * wakeup flag. */ -smp_mb(); -if (*sq_ring->flags & IORING_SQ_NEED_WAKEUP) +unsigned flags = atomic_load_relaxed(sq_ring->flags); +if (flags & IORING_SQ_NEED_WAKEUP) io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP); .EE .in