Skip to content

Commit f026be0

Browse files
isilenceaxboe
authored andcommitted
nvme: optimise io_uring passthrough completion
Use IOU_F_TWQ_LAZY_WAKE via iou_cmd_exec_in_task_lazy() for passthrough commands completion. It further delays the execution of task_work for DEFER_TASKRUN until there are enough of task_work items queued to meet the waiting criteria, which reduces the number of wake ups we issue. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/ecdfacd0967a22d88b7779e2efd09e040825d0f8.1684154817.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5f3139f commit f026be0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvme/host/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
521521
if (cookie != NULL && blk_rq_is_poll(req))
522522
nvme_uring_task_cb(ioucmd, IO_URING_F_UNLOCKED);
523523
else
524-
io_uring_cmd_complete_in_task(ioucmd, nvme_uring_task_cb);
524+
io_uring_cmd_do_in_task_lazy(ioucmd, nvme_uring_task_cb);
525525

526526
return RQ_END_IO_FREE;
527527
}
@@ -543,7 +543,7 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io_meta(struct request *req,
543543
if (cookie != NULL && blk_rq_is_poll(req))
544544
nvme_uring_task_meta_cb(ioucmd, IO_URING_F_UNLOCKED);
545545
else
546-
io_uring_cmd_complete_in_task(ioucmd, nvme_uring_task_meta_cb);
546+
io_uring_cmd_do_in_task_lazy(ioucmd, nvme_uring_task_meta_cb);
547547

548548
return RQ_END_IO_NONE;
549549
}

0 commit comments

Comments
 (0)