linux-stable/block
Paolo Valente b5e02b484d block, bfq: check also in-flight I/O in dispatch plugging
Consider a sync bfq_queue Q that remains empty while in service, and
suppose that, when this happens, there is a fair amount of already
in-flight I/O not belonging to Q. In such a situation, I/O dispatching
may need to be plugged (until new I/O arrives for Q), for the
following reason.

The drive may decide to serve in-flight non-Q's I/O requests before
Q's ones, thereby delaying the arrival of new I/O requests for Q
(recall that Q is sync). If I/O-dispatching is not plugged, then,
while Q remains empty, a basically uncontrolled amount of I/O from
other queues may be dispatched too, possibly causing the service of
Q's I/O to be delayed even longer in the drive. This problem gets more
and more serious as the speed and the queue depth of the drive grow,
because, as these two quantities grow, the probability to find no
queue busy but many requests in flight grows too.

If Q has the same weight and priority as the other queues, then the
above delay is unlikely to cause any issue, because all queues tend to
undergo the same treatment. So, since not plugging I/O dispatching is
convenient for throughput, it is better not to plug. Things change in
case Q has a higher weight or priority than some other queue, because
Q's service guarantees may simply be violated. For this reason,
commit 1de0c4cd9e ("block, bfq: reduce idling only in symmetric
scenarios") does plug I/O in such an asymmetric scenario. Plugging
minimizes the delay induced by already in-flight I/O, and enables Q to
recover the bandwidth it may lose because of this delay.

Yet the above commit does not cover the case of weight-raised queues,
for efficiency concerns. For weight-raised queues, I/O-dispatch
plugging is activated simply if not all bfq_queues are
weight-raised. But this check does not handle the case of in-flight
requests, because a bfq_queue may become non busy *before* all its
in-flight requests are completed.

This commit performs I/O-dispatch plugging for weight-raised queues if
there are some in-flight requests.

As a practical example of the resulting recover of control, under
write load on a Samsung SSD 970 PRO, gnome-terminal starts in 1.5
seconds after this fix, against 15 seconds before the fix (as a
reference, gnome-terminal takes about 35 seconds to start with any of
the other I/O schedulers).

Fixes: 1de0c4cd9e ("block, bfq: reduce idling only in symmetric scenarios")
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-18 07:22:15 -06:00
..
partitions block/partitions/ldm: Convert a kernel-doc header into a non-kernel-doc header 2019-05-31 15:12:34 -06:00
badblocks.c block: switch all files cleared marked as GPLv2 to SPDX tags 2019-04-30 16:11:57 -06:00
bfq-cgroup.c block: rename CONFIG_DEBUG_BLK_CGROUP to CONFIG_BFQ_CGROUP_DEBUG 2019-06-20 10:32:35 -06:00
bfq-iosched.c block, bfq: check also in-flight I/O in dispatch plugging 2019-07-18 07:22:15 -06:00
bfq-iosched.h block, bfq: detect wakers and unconditionally inject their I/O 2019-06-25 09:07:34 -06:00
bfq-wf2q.c block: switch all files cleared marked as GPLv2 or later to SPDX tags 2019-04-30 16:11:59 -06:00
bio-integrity.c block/bio-integrity: fix a memory leak bug 2019-07-11 20:01:21 -06:00
bio.c block: Allow mapping of vmalloc-ed buffers 2019-07-11 20:04:36 -06:00
blk-cgroup.c blkcg: allow blkcg_policy->pd_stat() to print non-debug info too 2019-07-16 10:06:39 -06:00
blk-core.c block: Disable write plugging for zoned block devices 2019-07-10 14:18:01 -06:00
blk-exec.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
blk-flush.c block: switch all files cleared marked as GPLv2 to SPDX tags 2019-04-30 16:11:57 -06:00
blk-integrity.c for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
blk-ioc.c block: remove the queue_lock indirection 2018-11-15 12:17:28 -07:00
blk-iolatency.c blkcg: allow blkcg_policy->pd_stat() to print non-debug info too 2019-07-16 10:06:39 -06:00
blk-lib.c block: fix 32 bit overflow in __blkdev_issue_discard() 2018-11-14 08:17:18 -07:00
blk-map.c block: remove the bi_phys_segments field in struct bio 2019-06-20 10:29:22 -06:00
blk-merge.c block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES 2019-07-03 07:20:40 -06:00
blk-mq-cpumap.c blk-mq: Document the blk_mq_hw_queue_to_node() arguments 2019-05-31 15:12:34 -06:00
blk-mq-debugfs-zoned.c block: Cleanup license notice 2019-01-17 21:21:40 -07:00
blk-mq-debugfs.c for-5.3/block-20190708 2019-07-09 10:45:06 -07:00
blk-mq-debugfs.h blk-mq: no need to check return value of debugfs_create functions 2019-06-13 03:00:30 -06:00
blk-mq-pci.c block: Fix blk_mq_*_map_queues() kernel-doc headers 2019-05-31 15:12:34 -06:00
blk-mq-rdma.c block: Fix blk_mq_*_map_queues() kernel-doc headers 2019-05-31 15:12:34 -06:00
blk-mq-sched.c blk-mq: remove blk_mq_put_ctx() 2019-07-02 21:03:27 -06:00
blk-mq-sched.h block: remove the bi_phys_segments field in struct bio 2019-06-20 10:29:22 -06:00
blk-mq-sysfs.c for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
blk-mq-tag.c blk-mq: remove blk_mq_put_ctx() 2019-07-02 21:03:27 -06:00
blk-mq-tag.h Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
blk-mq-virtio.c block: Fix blk_mq_*_map_queues() kernel-doc headers 2019-05-31 15:12:34 -06:00
blk-mq.c block: Disable write plugging for zoned block devices 2019-07-10 14:18:01 -06:00
blk-mq.h block: Disable write plugging for zoned block devices 2019-07-10 14:18:01 -06:00
blk-pm.c block: remove the queue_lock indirection 2018-11-15 12:17:28 -07:00
blk-pm.h block: remove the queue_lock indirection 2018-11-15 12:17:28 -07:00
blk-rq-qos.c block: Fix rq_qos_wait() kernel-doc header 2019-05-31 15:12:34 -06:00
blk-rq-qos.h block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
blk-settings.c block: force an unlimited segment size on queues with a virt boundary 2019-05-23 10:25:26 -06:00
blk-softirq.c block: remove a few unused exports 2018-11-15 12:13:25 -07:00
blk-stat.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
blk-stat.h block: deactivate blk_stat timer in wbt_disable_default() 2018-12-12 06:47:51 -07:00
blk-sysfs.c block: free sched's request pool in blk_cleanup_queue 2019-06-06 22:39:39 -06:00
blk-throttle.c blk-throttle: fix zero wait time for iops throttled group 2019-07-10 09:00:57 -06:00
blk-timeout.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
blk-wbt.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
blk-wbt.h block: remove external dependency on wbt_flags 2018-07-09 09:07:54 -06:00
blk-zoned.c block: Limit zone array allocation size 2019-07-11 20:04:40 -06:00
blk.h block: mark blk_rq_bio_prep as inline 2019-06-20 10:29:22 -06:00
bounce.c block: remove the i argument to bio_for_each_segment_all 2019-04-30 09:26:13 -06:00
bsg-lib.c block: Fix bsg_setup_queue() kernel-doc header 2019-05-31 15:12:34 -06:00
bsg.c block: switch all files cleared marked as GPLv2 to SPDX tags 2019-04-30 16:11:57 -06:00
cmdline-parser.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
elevator.c block: free sched's request pool in blk_cleanup_queue 2019-06-06 22:39:39 -06:00
genhd.c block: fix sysfs module parameters directory path in comment 2019-07-16 10:16:33 -06:00
ioctl.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
ioprio.c block: add SPDX tags to block layer files missing licensing information 2019-04-30 16:12:03 -06:00
Kconfig Merge branch 'for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2019-07-08 21:35:12 -07:00
Kconfig.iosched block: rename CONFIG_DEBUG_BLK_CGROUP to CONFIG_BFQ_CGROUP_DEBUG 2019-06-20 10:32:35 -06:00
kyber-iosched.c blk-mq: remove blk_mq_put_ctx() 2019-07-02 21:03:27 -06:00
Makefile block: remove legacy IO schedulers 2018-11-07 13:42:32 -07:00
mq-deadline.c block: remove the bi_phys_segments field in struct bio 2019-06-20 10:29:22 -06:00
opal_proto.h block: sed-opal: check size of shadow mbr 2019-06-29 10:34:08 -06:00
partition-generic.c block: fix use-after-free on gendisk 2019-04-22 09:48:12 -06:00
scsi_ioctl.c block: switch all files cleared marked as GPLv2 to SPDX tags 2019-04-30 16:11:57 -06:00
sed-opal.c block: sed-opal: check size of shadow mbr 2019-06-29 10:34:08 -06:00
t10-pi.c block: switch all files cleared marked as GPLv2 to SPDX tags 2019-04-30 16:11:57 -06:00