ublk_drv: support to complete io command via task_work_add
authorMing Lei <ming.lei@redhat.com>
Wed, 13 Jul 2022 14:07:11 +0000 (22:07 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 13:15:48 +0000 (07:15 -0600)
commit0edb3696c1713c42f52acbd8355b545e58f782b1
tree8dd87ed20c47f5c19ed0153e8bb24bf20ff4c3a7
parent71f28f3136aff5890cd56de78abc673f8393cad9
ublk_drv: support to complete io command via task_work_add

Use task_work_add if it is available, since task_work_add can bring
up better performance, especially batching signaling ->ubq_daemon can
be done.

It is observed that task_work_add() can boost iops by +4% on random
4k io test. Also except for completing io command, all other code
paths are same with completing io command via
io_uring_cmd_complete_in_task.

Meantime add one flag of UBLK_F_URING_CMD_COMP_IN_TASK for comparing
the mode easily.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220713140711.97356-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h