History

Merge tag 'for-5.7/io_uring-2020-03-29' of git://git.kernel.dk/linux-block

Pull io_uring updates from Jens Axboe: "Here are the io_uring changes for this merge window. Light on new features this time around (just splice + buffer selection), lots of cleanups, fixes, and improvements to existing support. In particular, this contains: - Cleanup fixed file update handling for stack fallback (Hillf) - Re-work of how pollable async IO is handled, we no longer require thread offload to handle that. Instead we rely using poll to drive this, with task_work execution. - In conjunction with the above, allow expendable buffer selection, so that poll+recv (for example) no longer has to be a split operation. - Make sure we honor RLIMIT_FSIZE for buffered writes - Add support for splice (Pavel) - Linked work inheritance fixes and optimizations (Pavel) - Async work fixes and cleanups (Pavel) - Improve io-wq locking (Pavel) - Hashed link write improvements (Pavel) - SETUP_IOPOLL|SETUP_SQPOLL improvements (Xiaoguang)" * tag 'for-5.7/io_uring-2020-03-29' of git://git.kernel.dk/linux-block: (54 commits) io_uring: cleanup io_alloc_async_ctx() io_uring: fix missing 'return' in comment io-wq: handle hashed writes in chains io-uring: drop 'free_pfile' in struct io_file_put io-uring: drop completion when removing file io_uring: Fix ->data corruption on re-enqueue io-wq: close cancel gap for hashed linked work io_uring: make spdxcheck.py happy io_uring: honor original task RLIMIT_FSIZE io-wq: hash dependent work io-wq: split hashing and enqueueing io-wq: don't resched if there is no work io-wq: remove duplicated cancel code io_uring: fix truncated async read/readv and write/writev retry io_uring: dual license io_uring.h uapi header io_uring: io_uring_enter(2) don't poll while SETUP_IOPOLL|SETUP_SQPOLL enabled io_uring: Fix unused function warnings io_uring: add end-of-bits marker and build time verify it io_uring: provide means of removing buffers io_uring: add IOSQE_BUFFER_SELECT support for IORING_OP_RECVMSG ...

Linus Torvalds committed 6 years ago

Commit e59cd882 parents 1592614 3d9932a12 files · +1826 −856Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+38−4
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/*2/*
3 * Header file for the io_uring interface.3 * Header file for the io_uring interface.
4 *4 *
@@ -23,7 +23,10 @@ struct io_uring_sqe { · 18 unmodified lines
23 __u64 off; /* offset into file */23 __u64 off; /* offset into file */
24 __u64 addr2;24 __u64 addr2;
25 };25 };
26 __u64 addr; /* pointer to buffer or iovecs */26 union {
27 __u64 addr; /* pointer to buffer or iovecs */
28 __u64 splice_off_in;
29 };
27 __u32 len; /* buffer size or number of iovecs */30 __u32 len; /* buffer size or number of iovecs */
28 union {31 union {
29 __kernel_rwf_t rw_flags;32 __kernel_rwf_t rw_flags;
@@ -37,14 +40,21 @@ struct io_uring_sqe { · 7 unmodified lines
37 __u32 open_flags;40 __u32 open_flags;
38 __u32 statx_flags;41 __u32 statx_flags;
39 __u32 fadvise_advice;42 __u32 fadvise_advice;
43 __u32 splice_flags;
40 };44 };
41 __u64 user_data; /* data to be passed back at completion time */45 __u64 user_data; /* data to be passed back at completion time */
42 union {46 union {
43 struct {47 struct {
44 /* index into fixed buffers, if used */48 /* pack this to avoid bogus arm OABI complaints */
45 __u16 buf_index;49 union {
50 /* index into fixed buffers, if used */
51 __u16 buf_index;
52 /* for grouped buffer selection */
53 __u16 buf_group;
54 } __attribute__((packed));
46 /* personality to use, if used */55 /* personality to use, if used */
47 __u16 personality;56 __u16 personality;
57 __s32 splice_fd_in;
48 };58 };
49 __u64 __pad2[3];59 __u64 __pad2[3];
50 };60 };
@@ -56,6 +66,7 @@ enum { · 5 unmodified lines
56 IOSQE_IO_LINK_BIT,66 IOSQE_IO_LINK_BIT,
57 IOSQE_IO_HARDLINK_BIT,67 IOSQE_IO_HARDLINK_BIT,
58 IOSQE_ASYNC_BIT,68 IOSQE_ASYNC_BIT,
69 IOSQE_BUFFER_SELECT_BIT,
59};70};
60 71
61/*72/*
@@ -71,6 +82,8 @@ enum { · 9 unmodified lines
71#define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT)82#define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT)
72/* always go async */83/* always go async */
73#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)84#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
85/* select buffer from sqe->buf_group */
86#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)
74 87
75/*88/*
76 * io_uring_setup() flags89 * io_uring_setup() flags
@@ -113,6 +126,9 @@ enum { · 36 unmodified lines
113 IORING_OP_RECV,126 IORING_OP_RECV,
114 IORING_OP_OPENAT2,127 IORING_OP_OPENAT2,
115 IORING_OP_EPOLL_CTL,128 IORING_OP_EPOLL_CTL,
129 IORING_OP_SPLICE,
130 IORING_OP_PROVIDE_BUFFERS,
131 IORING_OP_REMOVE_BUFFERS,
116 132
117 /* this goes last, obviously */133 /* this goes last, obviously */
118 IORING_OP_LAST,134 IORING_OP_LAST,
@@ -128,6 +144,12 @@ enum { · 9 unmodified lines
128 */144 */
129#define IORING_TIMEOUT_ABS (1U << 0)145#define IORING_TIMEOUT_ABS (1U << 0)
130 146
147/*
148 * sqe->splice_flags
149 * extends splice(2) flags
150 */
151#define SPLICE_F_FD_IN_FIXED (1U << 31) /* the last bit of __u32 */
152
131/*153/*
132 * IO completion data structure (Completion Queue Entry)154 * IO completion data structure (Completion Queue Entry)
133 */155 */
@@ -137,6 +159,17 @@ struct io_uring_cqe { · 3 unmodified lines
137 __u32 flags;159 __u32 flags;
138};160};
139 161
162/*
163 * cqe->flags
164 *
165 * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
166 */
167#define IORING_CQE_F_BUFFER (1U << 0)
168
169enum {
170 IORING_CQE_BUFFER_SHIFT = 16,
171};
172
140/*173/*
141 * Magic offsets for the application to mmap the data it needs174 * Magic offsets for the application to mmap the data it needs
142 */175 */
@@ -204,6 +237,7 @@ struct io_uring_params { · 61 unmodified lines
204#define IORING_FEAT_SUBMIT_STABLE (1U << 2)237#define IORING_FEAT_SUBMIT_STABLE (1U << 2)
205#define IORING_FEAT_RW_CUR_POS (1U << 3)238#define IORING_FEAT_RW_CUR_POS (1U << 3)
206#define IORING_FEAT_CUR_PERSONALITY (1U << 4)239#define IORING_FEAT_CUR_PERSONALITY (1U << 4)
240#define IORING_FEAT_FAST_POLL (1U << 5)
207 241
208/*242/*
209 * io_uring_register(2) opcodes and arguments243 * io_uring_register(2) opcodes and arguments