engines/io_uring: ensure sqe stores are ordered SQ ring tail update
authorJens Axboe <axboe@kernel.dk>
Wed, 16 Jan 2019 05:06:05 +0000 (22:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Jan 2019 05:06:05 +0000 (22:06 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c

index 56af8d7181321c3ff0768687e43766c134d48e61..8c5d9deb65ab327392e2c0e948d32a9b785a09b4 100644 (file)
@@ -289,6 +289,8 @@ static enum fio_q_status fio_ioring_queue(struct thread_data *td,
        if (next_tail == *ring->head)
                return FIO_Q_BUSY;
 
+       /* ensure sqe stores are ordered with tail update */
+       write_barrier();
        ring->array[tail & ld->sq_ring_mask] = io_u->index;
        *ring->tail = next_tail;
        write_barrier();