Skip to content

Commit

Permalink
relax sq.flags atomic read
Browse files Browse the repository at this point in the history
Change the atomic read of the SQ flags field to be `relaxed`.

Refer to discussions in tokio-rs#197 and in particular, as pointed out in tokio-rs#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.
  • Loading branch information
FrankReh committed Apr 29, 2024
1 parent 4e52bca commit 95821ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 95821ae

Please sign in to comment.