engines/io_uring: delete fio_option_is_set() calls when submitting sqes
authorXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Thu, 12 Mar 2020 11:16:17 +0000 (19:16 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2020 12:58:43 +0000 (06:58 -0600)
commit1af441968064fd2bc85e9c7494c9d51a0de0b12f
tree558f6decaf7f44a0b39bc09aabfa3fdd5a0912aa
parent8324e5d5ffbe87080eebec1cd0c3c8a0751257de
engines/io_uring: delete fio_option_is_set() calls when submitting sqes

The fio_option_is_set() call in fio_ioring_prep() is time-consuming,
which will reduce sqe's submit rate drastically. To fix this issue,
add two new variables to record whether ioprio_class or ioprio_set
is set. I use a simple fio job to evaluate the performance:
    fio -name=fiotest -filename=/dev/nvme0n1 -iodepth=4 -thread -rw=read
    -ioengine=io_uring -hipri=0 -sqthread_poll=0 -direct=1 -bs=4k -size=10G
    -numjobs=1 -time_based -runtime=120

Before this patch:
  READ: bw=969MiB/s (1016MB/s), 969MiB/s-969MiB/s (1016MB/s-1016MB/s),
  io=114GiB (122GB), run=120001-120001msec

With this patch:
  READ: bw=1259MiB/s (1320MB/s), 1259MiB/s-1259MiB/s (1320MB/s-1320MB/s),
  io=148GiB (158GB), run=120001-120001msec

Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c