alistair23-linux/block
Federico Motta 2d29c9f89f block, bfq: improve asymmetric scenarios detection
bfq defines as asymmetric a scenario where an active entity, say E
(representing either a single bfq_queue or a group of other entities),
has a higher weight than some other entities.  If the entity E does sync
I/O in such a scenario, then bfq plugs the dispatch of the I/O of the
other entities in the following situation: E is in service but
temporarily has no pending I/O request.  In fact, without this plugging,
all the times that E stops being temporarily idle, it may find the
internal queues of the storage device already filled with an
out-of-control number of extra requests, from other entities. So E may
have to wait for the service of these extra requests, before finally
having its own requests served. This may easily break service
guarantees, with E getting less than its fair share of the device
throughput.  Usually, the end result is that E gets the same fraction of
the throughput as the other entities, instead of getting more, according
to its higher weight.

Yet there are two other more subtle cases where E, even if its weight is
actually equal to or even lower than the weight of any other active
entities, may get less than its fair share of the throughput in case the
above I/O plugging is not performed:
1. other entities issue larger requests than E;
2. other entities contain more active child entities than E (or in
   general tend to have more backlog than E).

In the first case, other entities may get more service than E because
they get larger requests, than those of E, served during the temporary
idle periods of E.  In the second case, other entities get more service
because, by having many child entities, they have many requests ready
for dispatching while E is temporarily idle.

This commit addresses this issue by extending the definition of
asymmetric scenario: a scenario is asymmetric when
- active entities representing bfq_queues have differentiated weights,
  as in the original definition
or (inclusive)
- one or more entities representing groups of entities are active.

This broader definition makes sure that I/O plugging will be performed
in all the above cases, provided that there is at least one active
group.  Of course, this definition is very coarse, so it will trigger
I/O plugging also in cases where it is not needed, such as, e.g.,
multiple active entities with just one child each, and all with the same
I/O-request size.  The reason for this coarse definition is just that a
finer-grained definition would be rather heavy to compute.

On the opposite end, even this new definition does not trigger I/O
plugging in all cases where there is no active group, and all bfq_queues
have the same weight.  So, in these cases some unfairness may occur if
there are asymmetries in I/O-request sizes.  We made this choice because
I/O plugging may lower throughput, and probably a user that has not
created any group cares more about throughput than about perfect
fairness.  At any rate, as for possible applications that may care about
service guarantees, bfq already guarantees a high responsiveness and a
low latency to soft real-time applications automatically.

Signed-off-by: Federico Motta <federico@willer.it>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-10-13 15:40:00 -06:00
..
partitions partitions/aix: append null character to print data from disk 2018-07-27 09:17:41 -06:00
badblocks.c badblocks: fix wrong return value in badblocks_set if badblocks are disabled 2017-11-03 11:29:50 -07:00
bfq-cgroup.c blkcg: fix ref count issue with bio_blkcg using task_css 2018-09-21 20:29:02 -06:00
bfq-iosched.c block, bfq: improve asymmetric scenarios detection 2018-10-13 15:40:00 -06:00
bfq-iosched.h block, bfq: improve asymmetric scenarios detection 2018-10-13 15:40:00 -06:00
bfq-wf2q.c block, bfq: improve asymmetric scenarios detection 2018-10-13 15:40:00 -06:00
bio-integrity.c block: remove bio_rewind_iter() 2018-09-06 15:12:24 -06:00
bio.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -06:00
blk-cgroup.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -06:00
blk-core.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -06:00
blk-exec.c blk-mq-sched: remove unused 'can_block' arg from blk_mq_sched_insert_request 2018-01-17 09:49:21 -07:00
blk-flush.c block: fix use-after-free in block flush handling 2018-06-09 06:37:14 -06:00
blk-integrity.c block: merge BIOVEC_SEG_BOUNDARY into biovec_phys_mergeable 2018-09-24 12:33:57 -06:00
blk-ioc.c block, mm: remove unnecessary __GFP_HIGH flag 2018-07-09 09:07:54 -06:00
blk-iolatency.c blk-iolatency: keep track of previous windows stats 2018-09-28 11:47:32 -06:00
blk-lib.c block: fix infinite loop if the device loses discard capability 2018-07-09 09:07:54 -06:00
blk-map.c Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block 2018-01-29 11:51:49 -08:00
blk-merge.c block: merge BIOVEC_SEG_BOUNDARY into biovec_phys_mergeable 2018-09-24 12:33:57 -06:00
blk-mq-cpumap.c blk-mq: don't keep offline CPUs mapped to hctx 0 2018-04-10 08:38:46 -06:00
blk-mq-debugfs-zoned.c block: Make struct request_queue smaller for CONFIG_BLK_DEV_ZONED=n 2018-07-09 09:07:52 -06:00
blk-mq-debugfs.c blk-mq-debugfs: Also show requests that have not yet been started 2018-10-05 08:16:58 -06:00
blk-mq-debugfs.h block: Make struct request_queue smaller for CONFIG_BLK_DEV_ZONED=n 2018-07-09 09:07:52 -06:00
blk-mq-pci.c blk-mq: code clean-up by adding an API to clear set->mq_map 2018-07-09 09:07:53 -06:00
blk-mq-rdma.c
blk-mq-sched.c blk-mq: init hctx sched after update ctx and hctx mapping 2018-08-21 09:02:55 -06:00
blk-mq-sched.h block: move call of scheduler's ->completed_request() hook 2018-09-27 17:34:52 -06:00
blk-mq-sysfs.c block drivers/block: Use octal not symbolic permissions 2018-05-24 13:38:59 -06:00
blk-mq-tag.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -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
blk-mq.c blk-mq: complete req in softirq context in case of single queue 2018-10-08 10:50:43 -06:00
blk-mq.h blk-mq: issue directly if hw queue isn't busy in case of 'none' 2018-07-17 16:04:00 -06:00
blk-pm.c blk-mq: Enable support for runtime power management 2018-09-26 15:11:29 -06:00
blk-pm.h block: Split blk_pm_add_request() and blk_pm_put_request() 2018-09-26 15:11:28 -06:00
blk-rq-qos.c blk-rq-qos: make depth comparisons unsigned 2018-07-22 11:30:53 -06:00
blk-rq-qos.h blk-rq-qos: make depth comparisons unsigned 2018-07-22 11:30:53 -06:00
blk-settings.c block: allow max_discard_segments to be stacked 2018-07-24 14:46:39 -06:00
blk-softirq.c blk-mq: complete req in softirq context in case of single queue 2018-10-08 10:50:43 -06:00
blk-stat.c block: export blk_stat_enable_accounting() 2018-09-27 17:34:54 -06:00
blk-stat.h blk-stat: export helpers for modifying blk_rq_stat 2018-07-09 09:07:54 -06:00
blk-sysfs.c blk-wbt: don't maintain inflight counts if disabled 2018-08-23 09:34:46 -06:00
blk-tag.c for-linus-20180616 2018-06-17 05:37:55 +09:00
blk-throttle.c blkcg: consolidate bio_issue_init to be a part of core 2018-09-21 20:29:08 -06:00
blk-timeout.c blk-mq: Fix timeout handling in case the timeout handler returns BLK_EH_DONE 2018-06-23 10:25:45 -06:00
blk-wbt.c blk-wbt: remove dead code 2018-08-27 13:32:12 -06:00
blk-wbt.h block: remove external dependency on wbt_flags 2018-07-09 09:07:54 -06:00
blk-zoned.c block: Remove a superfluous cast from blkdev_report_zones() 2018-07-09 09:07:52 -06:00
blk.h block: remove ARCH_BIOVEC_PHYS_MERGEABLE 2018-09-26 08:45:11 -06:00
bounce.c blkcg: remove bio->bi_css and instead use bio->bi_blkg 2018-09-21 20:29:13 -06:00
bsg-lib.c block/bsg-lib: use PTR_ERR_OR_ZERO to simplify the flow path 2018-08-01 09:13:03 -06:00
bsg.c block: bsg: move atomic_t ref_count variable to refcount API 2018-08-27 19:17:02 -06:00
cfq-iosched.c cfq: clear queue pointers from cfqg after unpinning them in cfq_pd_offline 2018-10-11 11:46:19 -06:00
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c block drivers/block: Use octal not symbolic permissions 2018-05-24 13:38:59 -06:00
elevator.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -06:00
genhd.c This is the 4.19-rc6 release 2018-10-01 08:58:57 -06:00
ioctl.c block: pass inclusive 'lend' parameter to truncate_inode_pages_range 2018-02-23 15:20:19 -07:00
ioprio.c block: add ioprio_check_cap function 2018-05-31 10:50:54 -04:00
Kconfig block: remove redundant 'default n' from Kconfig-s 2018-10-10 14:11:07 -06:00
Kconfig.iosched block: remove redundant 'default n' from Kconfig-s 2018-10-10 14:11:07 -06:00
kyber-iosched.c kyber: fix integer overflow of latency targets on 32-bit 2018-09-28 10:49:39 -06:00
Makefile block: Move power management code into a new source file 2018-09-26 15:11:28 -06:00
mq-deadline.c block drivers/block: Use octal not symbolic permissions 2018-05-24 13:38:59 -06:00
noop-iosched.c
opal_proto.h
partition-generic.c block: use nanosecond resolution for iostat 2018-09-21 20:26:59 -06:00
scsi_ioctl.c block: consistently use GFP_NOIO instead of __GFP_NORECLAIM 2018-05-14 08:55:18 -06:00
sed-opal.c block: sed-opal: Fix a couple off by one bugs 2018-06-20 12:04:06 -06:00
t10-pi.c block: move dif_prepare/dif_complete functions to block layer 2018-07-30 08:27:02 -06:00