sq_ring_needs_enter(): force loading of kflags
ring->sq.kflags is set by the kernel. Ensure the compiler always loads
the value from memory when doing the check.
@@ -152,7 +152,7 @@ static inline bool sq_ring_needs_enter(struct io_uring *ring, unsigned *flags)
{
if (!(ring->flags & IORING_SETUP_SQPOLL))
return true;
- if ((*ring->sq.kflags & IORING_SQ_NEED_WAKEUP)) {
+ if (IO_URING_READ_ONCE(*ring->sq.kflags) & IORING_SQ_NEED_WAKEUP) {
*flags |= IORING_ENTER_SQ_WAKEUP;
return true;
}
