• Hou Tao's avatar
    bfq: dispatch request to prevent queue stalling after the request completion · 3f7cb4f4
    Hou Tao authored
    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: default avatarHou Tao <houtao1@huawei.com>
    Reviewed-by: default avatarPaolo Valente <paolo.valente@linaro.org>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    3f7cb4f4
Name
Last commit
Last update
..
partitions Loading commit data...
Kconfig Loading commit data...
Kconfig.iosched Loading commit data...
Makefile Loading commit data...
badblocks.c Loading commit data...
bfq-cgroup.c Loading commit data...
bfq-iosched.c Loading commit data...
bfq-iosched.h Loading commit data...
bfq-wf2q.c Loading commit data...
bio-integrity.c Loading commit data...
bio.c Loading commit data...
blk-cgroup.c Loading commit data...
blk-core.c Loading commit data...
blk-exec.c Loading commit data...
blk-flush.c Loading commit data...
blk-integrity.c Loading commit data...
blk-ioc.c Loading commit data...
blk-lib.c Loading commit data...
blk-map.c Loading commit data...
blk-merge.c Loading commit data...
blk-mq-cpumap.c Loading commit data...
blk-mq-debugfs.c Loading commit data...
blk-mq-debugfs.h Loading commit data...
blk-mq-pci.c Loading commit data...
blk-mq-sched.c Loading commit data...
blk-mq-sched.h Loading commit data...
blk-mq-sysfs.c Loading commit data...
blk-mq-tag.c Loading commit data...
blk-mq-tag.h Loading commit data...
blk-mq-virtio.c Loading commit data...
blk-mq.c Loading commit data...
blk-mq.h Loading commit data...
blk-settings.c Loading commit data...
blk-softirq.c Loading commit data...
blk-stat.c Loading commit data...
blk-stat.h Loading commit data...
blk-sysfs.c Loading commit data...
blk-tag.c Loading commit data...
blk-throttle.c Loading commit data...
blk-timeout.c Loading commit data...
blk-wbt.c Loading commit data...
blk-wbt.h Loading commit data...
blk-zoned.c Loading commit data...
blk.h Loading commit data...
bounce.c Loading commit data...
bsg-lib.c Loading commit data...
bsg.c Loading commit data...
cfq-iosched.c Loading commit data...
cmdline-parser.c Loading commit data...
compat_ioctl.c Loading commit data...
deadline-iosched.c Loading commit data...
elevator.c Loading commit data...
genhd.c Loading commit data...
ioctl.c Loading commit data...
ioprio.c Loading commit data...
kyber-iosched.c Loading commit data...
mq-deadline.c Loading commit data...
noop-iosched.c Loading commit data...
opal_proto.h Loading commit data...
partition-generic.c Loading commit data...
scsi_ioctl.c Loading commit data...
sed-opal.c Loading commit data...
t10-pi.c Loading commit data...