From ecefd7958eb32602df07f12e9808598b2c2de84b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 1 Jul 2019 14:42:32 -0700 Subject: Fix the use of memory barriers Introduce the smp_load_acquire() and smp_store_release() macros. Fix synchronization in io_uring_cq_advance() and __io_uring_get_cqe(). Remove a superfluous local variable, if-test and write barrier from __io_uring_submit(). Remove a superfluous barrier from test/io_uring_enter.c. Cc: Stefan Hajnoczi Cc: Roman Penyaev Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe --- man/io_uring_setup.2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'man/io_uring_setup.2') diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2 index ebaee2d..9ab0143 100644 --- a/man/io_uring_setup.2 +++ b/man/io_uring_setup.2 @@ -97,7 +97,11 @@ call with the following code sequence: .in +4n .EX -read_barrier(); +/* + * Ensure that the wakeup flag is read after the tail pointer has been + * written. + */ +smp_mb(); if (*sq_ring->flags & IORING_SQ_NEED_WAKEUP) io_uring_enter(fd, 0, 0, IORING_ENTER_SQ_WAKEUP); .EE -- cgit