blk-mq: insert flush request to the front of dispatch queue
Ming Lei authored
[ Upstream commit cc3200ea ]

commit 01e99aec ("blk-mq: insert passthrough request into
hctx->dispatch directly") may change to add flush request to the tail
of dispatch by applying the 'add_head' parameter of
blk_mq_sched_insert_request.

Turns out this way causes performance regression on NCQ controller because
flush is non-NCQ command, which can't be queued when there is any in-flight
NCQ command. When adding flush rq to the front of hctx->dispatch, it is
easier to introduce extra time to flush rq's latency compared with adding
to the tail of dispatch queue because of S_SCHED_RESTART, then chance of
flush merge is increased, and less flush requests may be issued to
controller.

So always insert flush request to the front of dispatch queue just like
before applying commit 01e99aec

 ("blk-mq: insert passthrough request
into hctx->dispatch directly").

Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reported-by: default avatarShinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 01e99aec

 ("blk-mq: insert passthrough request into hctx->dispatch directly")
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
56b1d6bd
Name Last commit Last update
..
partitions docs: admin-guide: add a series of orphaned documents
Kconfig blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT
Kconfig.iosched blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT
Makefile blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT
badblocks.c block: switch all files cleared marked as GPLv2 to SPDX tags
bfq-cgroup.c block, bfq: remove ifdefs from around gets/puts of bfq groups
bfq-iosched.c block, bfq: remove ifdefs from around gets/puts of bfq groups
bfq-iosched.h block, bfq: remove ifdefs from around gets/puts of bfq groups
bfq-wf2q.c block, bfq: get a ref to a group when adding it to a service tree
bio-integrity.c block: fix memleak of bio integrity data
bio.c fs: move guard_bio_eod() after bio_set_op_attrs
blk-cgroup-rwstat.c blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT
blk-cgroup-rwstat.h blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT
blk-cgroup.c blk-cgroup: remove blkcg_drain_queue
blk-core.c block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT
blk-exec.c block: account statistics for passthrough requests
blk-flush.c blk-mq: insert passthrough request into hctx->dispatch directly
blk-integrity.c block: centralize PI remapping logic to the block layer
blk-ioc.c block: remove the queue_lock indirection
blk-iocost.c blk-iocost: fix incorrect vtime comparison in iocg_is_idle()
blk-iolatency.c blkcg: s/RQ_QOS_CGROUP/RQ_QOS_LATENCY/
blk-lib.c block: fix 32 bit overflow in __blkdev_issue_discard()
blk-map.c block: fix memleak when __blk_rq_map_user_iov() is failed
blk-merge.c block: fix get_max_segment_size() overflow on 32bit arch
blk-mq-cpumap.c blk-mq: balance mapping between present CPUs and queues
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c
blk-throttle.c
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c
blk.h
bounce.c
bsg-lib.c
bsg.c
cmdline-parser.c
compat_ioctl.c
elevator.c
genhd.c
ioctl.c
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h
partition-generic.c
scsi_ioctl.c
sed-opal.c
t10-pi.c