From 0f1d7741284754ce42e129dc91918f85c2e87fa4 Mon Sep 17 00:00:00 2001 From: Sebastian Hasler Date: Fri, 15 Sep 2023 02:47:30 +0200 Subject: [PATCH] man/io_uring_setup.2: fix memory ordering Signed-off-by: Sebastian Hasler --- man/io_uring_setup.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2 index 9710aa511..5e937c936 100644 --- a/man/io_uring_setup.2 +++ b/man/io_uring_setup.2 @@ -109,11 +109,11 @@ call with the following code sequence: .EX /* * 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. + * has been written. A full memory barrier is required because + * this is a read-after-write (which cannot be synchronized + * using acquire/release memory ordering). */ +smp_mb(); unsigned flags = atomic_load_relaxed(sq_ring->flags); if (flags & IORING_SQ_NEED_WAKEUP) io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP);