io_uring engine: 'atomic_load_relaxed' instead of 'atomic_load_acquire'
authorDenis Pronin <dannftk@yandex.ru>
Fri, 28 Jul 2023 14:25:06 +0000 (17:25 +0300)
committerDenis Pronin <dannftk@yandex.ru>
Fri, 28 Jul 2023 14:25:06 +0000 (17:25 +0300)
motivation here is that we do not have here any explicit READ dependency
 on atomic load because actually we just need in these places only
 operation to perform atomically without any explicit barriers given by
 memory model

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
engines/io_uring.c

index e1abf6888fd50c886b87ecc29cf25519c8bbba9d..b361e6a5bbad6ab16cd97f6bcdbb28779ef7d54c 100644 (file)
@@ -509,7 +509,7 @@ static enum fio_q_status fio_ioring_queue(struct thread_data *td,
 
        tail = *ring->tail;
        next_tail = tail + 1;
-       if (next_tail == atomic_load_acquire(ring->head))
+       if (next_tail == atomic_load_relaxed(ring->head))
                return FIO_Q_BUSY;
 
        if (ld->cmdprio.mode != CMDPRIO_MODE_NONE)
@@ -569,7 +569,7 @@ static int fio_ioring_commit(struct thread_data *td)
                unsigned start = *ld->sq_ring.tail - ld->queued;
                unsigned flags;
 
-               flags = atomic_load_acquire(ring->flags);
+               flags = atomic_load_relaxed(ring->flags);
                if (flags & IORING_SQ_NEED_WAKEUP)
                        io_uring_enter(ld, ld->queued, 0,
                                        IORING_ENTER_SQ_WAKEUP);