summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-04-21 21:06:30 -0600
committerJens Axboe <axboe@kernel.dk>2022-04-21 21:06:30 -0600
commit37b06ec2702f4e2014570118cde4f51ce62fce1b (patch)
tree204bd934dcf061f97ae07dbfd3959613f53ae54d
parent4ad972d6d1b16e4fb069fc2f006265942cf33103 (diff)
downloadliburing-no-ipi.tar.gz
liburing-no-ipi.tar.bz2
queue: include IORING_SQ_TW flag in checking if we need to enter the kernelno-ipi
If this flag is set, then we need to enter the kernel to finish completions. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing/io_uring.h1
-rw-r--r--src/queue.c3
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)