diff options
-rw-r--r-- | src/include/liburing/io_uring.h | 1 | ||||
-rw-r--r-- | src/queue.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h index bfb3548..75562f8 100644 --- a/src/include/liburing/io_uring.h +++ b/src/include/liburing/io_uring.h @@ -240,6 +240,7 @@ struct io_sqring_offsets { */ #define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */ #define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */ +#define IORING_SQ_TW (1U << 2) /* task needs to enter the kernel */ struct io_cqring_offsets { __u32 head; diff --git a/src/queue.c b/src/queue.c index 856d270..692b3e4 100644 --- a/src/queue.c +++ b/src/queue.c @@ -35,7 +35,8 @@ static inline bool sq_ring_needs_enter(struct io_uring *ring, unsigned *flags) static inline bool cq_ring_needs_flush(struct io_uring *ring) { - return IO_URING_READ_ONCE(*ring->sq.kflags) & IORING_SQ_CQ_OVERFLOW; + return IO_URING_READ_ONCE(*ring->sq.kflags) & + (IORING_SQ_CQ_OVERFLOW | IORING_SQ_TW); } static inline bool cq_ring_needs_enter(struct io_uring *ring) |