From 95821ae72372943693a370133dcad15a895dc219 Mon Sep 17 00:00:00 2001 From: Frank Rehwinkel Date: Mon, 29 Apr 2024 07:02:06 -0400 Subject: [PATCH] relax sq.flags atomic read Change the atomic read of the SQ flags field to be `relaxed`. Refer to discussions in #197 and in particular, as pointed out in #197, refer to the liburing library loads of this same field. The liburing library names this field sq.kflags and all its atomic loads are performed with their IO_URING_READ_ONCE macro, which it defines to be the `relaxed` atomic load. --- src/submit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submit.rs b/src/submit.rs index 0f41c74..4f68dac 100644 --- a/src/submit.rs +++ b/src/submit.rs @@ -66,7 +66,7 @@ impl<'a> Submitter<'a> { /// CQ ring is overflown fn sq_cq_overflow(&self) -> bool { unsafe { - (*self.sq_flags).load(atomic::Ordering::Acquire) & sys::IORING_SQ_CQ_OVERFLOW != 0 + (*self.sq_flags).load(atomic::Ordering::Relaxed) & sys::IORING_SQ_CQ_OVERFLOW != 0 } }