History

io_uring: expose single mmap capability

After commit 75b28affdd6a we can get by with just a single mmap to map both the sq and cq ring. However, userspace doesn't know that. Add a features variable to io_uring_params, and notify userspace that the kernel has this ability. This can then be used in liburing (or in applications directly) to avoid the second mmap.

Jens Axboe committed 7 years ago

Commit ac90f241 parent 75b28af2 files · +9 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+7−1
@@ -128,11 +128,17 @@ struct io_uring_params { · 127 unmodified lines
128 __u32 flags;128 __u32 flags;
129 __u32 sq_thread_cpu;129 __u32 sq_thread_cpu;
130 __u32 sq_thread_idle;130 __u32 sq_thread_idle;
131 __u32 resv[5];131 __u32 features;
132 __u32 resv[4];
132 struct io_sqring_offsets sq_off;133 struct io_sqring_offsets sq_off;
133 struct io_cqring_offsets cq_off;134 struct io_cqring_offsets cq_off;
134};135};
135 136
137/*
138 * io_uring_params->features flags
139 */
140#define IORING_FEAT_SINGLE_MMAP (1U << 0)
141
136/*142/*
137 * io_uring_register(2) opcodes and arguments143 * io_uring_register(2) opcodes and arguments
138 */144 */