io_uring: sync with kernel
authorJens Axboe <axboe@kernel.dk>
Mon, 28 Jan 2019 18:42:20 +0000 (11:42 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Jan 2019 18:42:20 +0000 (11:42 -0700)
- Update to newer kernel API header
- Use IORING_ENTER_SQ_WAKEUP

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
os/linux/io_uring.h
t/io_uring.c

index c759ec19fc86d6ac80cdbcc6c43f5723d77b882c..5279b1d0ffb7d38ba9ceb144b99ba26dd690574d 100644 (file)
@@ -340,7 +340,8 @@ static int fio_ioring_commit(struct thread_data *td)
 
                read_barrier();
                if (*ring->flags & IORING_SQ_NEED_WAKEUP)
-                       io_uring_enter(ld, ld->queued, 0, 0);
+                       io_uring_enter(ld, ld->queued, 0,
+                                       IORING_ENTER_SQ_WAKEUP);
                ld->queued = 0;
                return 0;
        }
index 9bb718168c86d4a98e774a56c36d63c538cfceaa..589b6402081d38b709de967f8df32b06678c2ffd 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/fs.h>
 #include <linux/types.h>
 
+#define IORING_MAX_ENTRIES     4096
+
 /*
  * IO submission data structure (Submission Queue Entry)
  */
@@ -25,6 +27,7 @@ struct io_uring_sqe {
        union {
                __kernel_rwf_t  rw_flags;
                __u32           fsync_flags;
+               __u16           poll_events;
        };
        __u64   user_data;      /* data to be passed back at completion time */
        union {
@@ -51,6 +54,8 @@ struct io_uring_sqe {
 #define IORING_OP_FSYNC                3
 #define IORING_OP_READ_FIXED   4
 #define IORING_OP_WRITE_FIXED  5
+#define IORING_OP_POLL_ADD     6
+#define IORING_OP_POLL_REMOVE  7
 
 /*
  * sqe->fsync_flags
@@ -111,6 +116,7 @@ struct io_cqring_offsets {
  * io_uring_enter(2) flags
  */
 #define IORING_ENTER_GETEVENTS (1 << 0)
+#define IORING_ENTER_SQ_WAKEUP (1 << 1)
 
 /*
  * Passed in for io_uring_setup(2). Copied back with updated info on success
@@ -120,7 +126,8 @@ struct io_uring_params {
        __u32 cq_entries;
        __u32 flags;
        __u16 sq_thread_cpu;
-       __u16 resv[9];
+       __u16 sq_thread_idle;
+       __u16 resv[8];
        struct io_sqring_offsets sq_off;
        struct io_cqring_offsets cq_off;
 };
index da3b4d1f4a8f16bfb23ed3c37ac9a33699ffcf1a..9ded1590999ed0cf2e89566fc3e8e471d561dfee 100644 (file)
@@ -315,6 +315,8 @@ submit:
 
                        if (to_wait)
                                flags = IORING_ENTER_GETEVENTS;
+                       if (*ring->flags & IORING_SQ_NEED_WAKEUP)
+                               flags |= IORING_ENTER_SQ_WAKEUP;
                        ret = io_uring_enter(s, to_submit, to_wait, flags);
                        s->calls++;
                }