summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornilios Kourtis <kkourt@kkourt.io>2019-10-30 16:07:53 +0100
committerJens Axboe <axboe@kernel.dk>2019-10-30 09:09:57 -0600
commit4fcf0777c4c334d0b785baed0ec72411905001e9 (patch)
treec8d8a6361dc6b1e735b3223dffb32c2a17f7fb18
parenta8b3b787a235e9f37efb75528ee1aede6c5ed948 (diff)
downloadliburing-4fcf0777c4c334d0b785baed0ec72411905001e9.tar.gz
liburing-4fcf0777c4c334d0b785baed0ec72411905001e9.tar.bz2
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. Signed-off-by: Kornilios Kourtis <kornilios@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/queue.c b/src/queue.c
index 1c8896e..758fce8 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -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;
}