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/nop: add IORING_NOP_TW completion flag

To test and profile the overhead of io_uring task_work and the various
types of it, add IORING_NOP_TW which tells nop to signal completions
through task_work rather than complete them inline.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

Jens Axboe cb9ccfb4 ecf47d45

+8 -1
+1
include/uapi/linux/io_uring.h
··· 449 449 #define IORING_NOP_FILE (1U << 1) 450 450 #define IORING_NOP_FIXED_FILE (1U << 2) 451 451 #define IORING_NOP_FIXED_BUFFER (1U << 3) 452 + #define IORING_NOP_TW (1U << 4) 452 453 453 454 /* 454 455 * IO completion data structure (Completion Queue Entry)
+7 -1
io_uring/nop.c
··· 20 20 }; 21 21 22 22 #define NOP_FLAGS (IORING_NOP_INJECT_RESULT | IORING_NOP_FIXED_FILE | \ 23 - IORING_NOP_FIXED_BUFFER | IORING_NOP_FILE) 23 + IORING_NOP_FIXED_BUFFER | IORING_NOP_FILE | \ 24 + IORING_NOP_TW) 24 25 25 26 int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) 26 27 { ··· 69 68 if (ret < 0) 70 69 req_set_fail(req); 71 70 io_req_set_res(req, nop->result, 0); 71 + if (nop->flags & IORING_NOP_TW) { 72 + req->io_task_work.func = io_req_task_complete; 73 + io_req_task_work_add(req); 74 + return IOU_ISSUE_SKIP_COMPLETE; 75 + } 72 76 return IOU_COMPLETE; 73 77 }