linux/block
Hou Tao 3f7cb4f413 bfq: dispatch request to prevent queue stalling after the request completion
There are mq devices (eg., virtio-blk, nbd and loopback) which don't
invoke blk_mq_run_hw_queues() after the completion of a request.
If bfq is enabled on these devices and the slice_idle attribute or
strict_guarantees attribute is set as zero, it is possible that
after a request completion the remaining requests of busy bfq queue
will stalled in the bfq schedule until a new request arrives.

To fix the scheduler latency problem, we need to check whether or not
all issued requests have completed and dispatch more requests to driver
if there is no request in driver.

The problem can be reproduced by running the following script
on a virtio-blk device with nr_hw_queues as 1:

#!/bin/sh

dev=vdb
# mount point for dev
mp=/tmp/mnt
cd $mp

job=strict.job
cat <<EOF > $job
[global]
direct=1
bs=4k
size=256M
rw=write
ioengine=libaio
iodepth=128
runtime=5
time_based

[1]
filename=1.data

[2]
new_group
filename=2.data
EOF

echo bfq > /sys/block/$dev/queue/scheduler
echo 1 > /sys/block/$dev/queue/iosched/strict_guarantees
fio $job

Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-07-12 08:32:04 -06:00
..
partitions partitions/ldm: switch to use uuid_t 2017-06-05 16:59:14 +02:00
badblocks.c block: Add fallthrough markers to switch statements 2017-06-21 11:46:07 -06:00
bfq-cgroup.c block, bfq: access and cache blkg data only when safe 2017-06-08 09:51:10 -06:00
bfq-iosched.c bfq: dispatch request to prevent queue stalling after the request completion 2017-07-12 08:32:04 -06:00
bfq-iosched.h bfq: fix typos in comments about B-WF2Q+ algorithm 2017-07-12 08:32:02 -06:00
bfq-wf2q.c bfq: fix typos in comments about B-WF2Q+ algorithm 2017-07-12 08:32:02 -06:00
bio-integrity.c bio-integrity: fix boolreturn.cocci warnings 2017-07-04 16:11:53 -06:00
bio.c block: call bio_uninit in bio_endio 2017-07-10 12:43:33 -06:00
blk-cgroup.c block: Avoid that blk_exit_rl() triggers a use-after-free 2017-06-01 13:07:55 -06:00
blk-core.c bio-integrity: fold bio_integrity_enabled to bio_integrity_prep 2017-07-03 16:56:24 -06:00
blk-exec.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
blk-flush.c block: Check locking assumptions at runtime 2017-06-20 19:27:14 -06:00
blk-integrity.c block: switch bios to blk_status_t 2017-06-09 09:27:32 -06:00
blk-ioc.c
blk-lib.c block: Fix __blkdev_issue_zeroout loop 2017-07-06 09:43:20 -06:00
blk-map.c blk-map: call blk_queue_bounce from blk_rq_append_bio 2017-06-27 12:13:21 -06:00
blk-merge.c block: add support for write hints in a bio 2017-06-27 12:05:27 -06:00
blk-mq-cpumap.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:50:31 -07:00
blk-mq-debugfs.c blk-mq: expose write hints through debugfs 2017-06-27 12:05:31 -06:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-sched.c blk-mq-sched: fix performance regression of mq-deadline 2017-07-03 16:54:09 -06:00
blk-mq-sched.h Merge commit '8e8320c9315c' into for-4.13/block 2017-06-22 21:55:24 -06:00
blk-mq-sysfs.c blk-mq: untangle debugfs and sysfs 2017-05-04 08:24:13 -06:00
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2017-07-11 15:36:52 -07:00
blk-mq.h Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:50:31 -07:00
blk-settings.c block: don't bother with bounce limits for make_request drivers 2017-06-27 12:13:45 -06:00
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c block: Fix a blk_exit_rl() regression 2017-06-14 13:27:50 -06:00
blk-tag.c block: Check locking assumptions at runtime 2017-06-20 19:27:14 -06:00
blk-throttle.c blk-throttle: set default latency baseline for harddisk 2017-06-07 09:09:32 -06:00
blk-timeout.c block: Check locking assumptions at runtime 2017-06-20 19:27:14 -06:00
blk-wbt.c sched/wait: Disambiguate wq_entry->task_list and wq_head->task_list naming 2017-06-20 12:19:14 +02:00
blk-wbt.h
blk-zoned.c
blk.h bio-integrity: stop abusing bi_end_io 2017-07-03 17:00:59 -06:00
bounce.c block: remove the queue_bounce_pfn helper 2017-06-27 12:13:45 -06:00
bsg-lib.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
bsg.c block: Make most scsi_req_init() calls implicit 2017-06-20 19:27:14 -06:00
cfq-iosched.c Linux 4.12-rc5 2017-06-12 08:30:13 -06:00
cmdline-parser.c
compat_ioctl.c compat_hdio_ioctl: get rid of set_fs() 2017-06-29 18:17:52 -04:00
deadline-iosched.c
elevator.c block: Add fallthrough markers to switch statements 2017-06-21 11:46:07 -06:00
genhd.c block: Constify disk_type 2017-06-20 19:27:14 -06:00
ioctl.c
ioprio.c block: Add fallthrough markers to switch statements 2017-06-21 11:46:07 -06:00
Kconfig Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm 2017-05-12 15:43:10 -07:00
Kconfig.iosched
kyber-iosched.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 13:08:04 -07:00
Makefile
mq-deadline.c
noop-iosched.c
opal_proto.h
partition-generic.c block: fix an error code in add_partition() 2017-05-23 08:41:59 -06:00
scsi_ioctl.c block: Change argument type of scsi_req_init() 2017-06-20 19:27:14 -06:00
sed-opal.c
t10-pi.c t10-pi: Move opencoded contants to common header 2017-07-03 16:56:25 -06:00