Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: add IO_URING_F_INLINE issue flag

Set when the execution of the request is done inline from the system
call itself. Any deferred issue will never have this flag set.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Jens Axboe 4d811e39 86731a2a

+9 -5
+2
include/linux/io_uring_types.h
··· 26 26 IO_URING_F_MULTISHOT = 4, 27 27 /* executed by io-wq */ 28 28 IO_URING_F_IOWQ = 8, 29 + /* executed inline from syscall */ 30 + IO_URING_F_INLINE = 16, 29 31 /* int's last bit, sign checks are usually faster than a bit test */ 30 32 IO_URING_F_NONBLOCK = INT_MIN, 31 33
+7 -5
io_uring/io_uring.c
··· 147 147 bool cancel_all, 148 148 bool is_sqpoll_thread); 149 149 150 - static void io_queue_sqe(struct io_kiocb *req); 150 + static void io_queue_sqe(struct io_kiocb *req, unsigned int extra_flags); 151 151 static void __io_req_caches_free(struct io_ring_ctx *ctx); 152 152 153 153 static __read_mostly DEFINE_STATIC_KEY_FALSE(io_key_has_sqarray); ··· 1377 1377 else if (req->flags & REQ_F_FORCE_ASYNC) 1378 1378 io_queue_iowq(req); 1379 1379 else 1380 - io_queue_sqe(req); 1380 + io_queue_sqe(req, 0); 1381 1381 } 1382 1382 1383 1383 void io_req_task_queue_fail(struct io_kiocb *req, int ret) ··· 1960 1960 } 1961 1961 } 1962 1962 1963 - static inline void io_queue_sqe(struct io_kiocb *req) 1963 + static inline void io_queue_sqe(struct io_kiocb *req, unsigned int extra_flags) 1964 1964 __must_hold(&req->ctx->uring_lock) 1965 1965 { 1966 + unsigned int issue_flags = IO_URING_F_NONBLOCK | 1967 + IO_URING_F_COMPLETE_DEFER | extra_flags; 1966 1968 int ret; 1967 1969 1968 - ret = io_issue_sqe(req, IO_URING_F_NONBLOCK|IO_URING_F_COMPLETE_DEFER); 1970 + ret = io_issue_sqe(req, issue_flags); 1969 1971 1970 1972 /* 1971 1973 * We async punt it if the file wasn't marked NOWAIT, or if the file ··· 2223 2221 return 0; 2224 2222 } 2225 2223 2226 - io_queue_sqe(req); 2224 + io_queue_sqe(req, IO_URING_F_INLINE); 2227 2225 return 0; 2228 2226 } 2229 2227