2005-11-04 07:43:35 +00:00
|
|
|
#
|
|
|
|
# Makefile for the kernel block layer
|
|
|
|
#
|
|
|
|
|
2014-05-19 14:16:41 +00:00
|
|
|
obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
|
2010-09-03 09:56:16 +00:00
|
|
|
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
|
2008-09-14 12:55:09 +00:00
|
|
|
blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
|
2016-11-08 04:32:37 +00:00
|
|
|
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
|
2017-01-17 13:03:22 +00:00
|
|
|
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
|
2017-01-28 08:32:51 +00:00
|
|
|
genhd.o partition-generic.o ioprio.o \
|
2015-12-25 02:20:32 +00:00
|
|
|
badblocks.o partitions/
|
2005-11-04 07:43:35 +00:00
|
|
|
|
2017-01-28 08:32:51 +00:00
|
|
|
obj-$(CONFIG_BOUNCE) += bounce.o
|
|
|
|
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
|
2007-07-09 10:38:05 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
|
2011-07-31 20:05:09 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
|
2009-12-03 17:59:42 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
|
2010-09-15 21:06:35 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_THROTTLING) += blk-throttle.o
|
2005-11-04 07:43:35 +00:00
|
|
|
obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
|
|
|
|
obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
|
|
|
|
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
|
2017-01-15 00:11:11 +00:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_DEADLINE) += mq-deadline.o
|
2017-04-14 08:00:02 +00:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o
|
block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler
We tag as v0 the version of BFQ containing only BFQ's engine plus
hierarchical support. BFQ's engine is introduced by this commit, while
hierarchical support is added by next commit. We use the v0 tag to
distinguish this minimal version of BFQ from the versions containing
also the features and the improvements added by next commits. BFQ-v0
coincides with the version of BFQ submitted a few years ago [1], apart
from the introduction of preemption, described below.
BFQ is a proportional-share I/O scheduler, whose general structure,
plus a lot of code, are borrowed from CFQ.
- Each process doing I/O on a device is associated with a weight and a
(bfq_)queue.
- BFQ grants exclusive access to the device, for a while, to one queue
(process) at a time, and implements this service model by
associating every queue with a budget, measured in number of
sectors.
- After a queue is granted access to the device, the budget of the
queue is decremented, on each request dispatch, by the size of the
request.
- The in-service queue is expired, i.e., its service is suspended,
only if one of the following events occurs: 1) the queue finishes
its budget, 2) the queue empties, 3) a "budget timeout" fires.
- The budget timeout prevents processes doing random I/O from
holding the device for too long and dramatically reducing
throughput.
- Actually, as in CFQ, a queue associated with a process issuing
sync requests may not be expired immediately when it empties. In
contrast, BFQ may idle the device for a short time interval,
giving the process the chance to go on being served if it issues
a new request in time. Device idling typically boosts the
throughput on rotational devices, if processes do synchronous
and sequential I/O. In addition, under BFQ, device idling is
also instrumental in guaranteeing the desired throughput
fraction to processes issuing sync requests (see [2] for
details).
- With respect to idling for service guarantees, if several
processes are competing for the device at the same time, but
all processes (and groups, after the following commit) have
the same weight, then BFQ guarantees the expected throughput
distribution without ever idling the device. Throughput is
thus as high as possible in this common scenario.
- Queues are scheduled according to a variant of WF2Q+, named
B-WF2Q+, and implemented using an augmented rb-tree to preserve an
O(log N) overall complexity. See [2] for more details. B-WF2Q+ is
also ready for hierarchical scheduling. However, for a cleaner
logical breakdown, the code that enables and completes
hierarchical support is provided in the next commit, which focuses
exactly on this feature.
- B-WF2Q+ guarantees a tight deviation with respect to an ideal,
perfectly fair, and smooth service. In particular, B-WF2Q+
guarantees that each queue receives a fraction of the device
throughput proportional to its weight, even if the throughput
fluctuates, and regardless of: the device parameters, the current
workload and the budgets assigned to the queue.
- The last, budget-independence, property (although probably
counterintuitive in the first place) is definitely beneficial, for
the following reasons:
- First, with any proportional-share scheduler, the maximum
deviation with respect to an ideal service is proportional to
the maximum budget (slice) assigned to queues. As a consequence,
BFQ can keep this deviation tight not only because of the
accurate service of B-WF2Q+, but also because BFQ *does not*
need to assign a larger budget to a queue to let the queue
receive a higher fraction of the device throughput.
- Second, BFQ is free to choose, for every process (queue), the
budget that best fits the needs of the process, or best
leverages the I/O pattern of the process. In particular, BFQ
updates queue budgets with a simple feedback-loop algorithm that
allows a high throughput to be achieved, while still providing
tight latency guarantees to time-sensitive applications. When
the in-service queue expires, this algorithm computes the next
budget of the queue so as to:
- Let large budgets be eventually assigned to the queues
associated with I/O-bound applications performing sequential
I/O: in fact, the longer these applications are served once
got access to the device, the higher the throughput is.
- Let small budgets be eventually assigned to the queues
associated with time-sensitive applications (which typically
perform sporadic and short I/O), because, the smaller the
budget assigned to a queue waiting for service is, the sooner
B-WF2Q+ will serve that queue (Subsec 3.3 in [2]).
- Weights can be assigned to processes only indirectly, through I/O
priorities, and according to the relation:
weight = 10 * (IOPRIO_BE_NR - ioprio).
The next patch provides, instead, a cgroups interface through which
weights can be assigned explicitly.
- If several processes are competing for the device at the same time,
but all processes and groups have the same weight, then BFQ
guarantees the expected throughput distribution without ever idling
the device. It uses preemption instead. Throughput is then much
higher in this common scenario.
- ioprio classes are served in strict priority order, i.e.,
lower-priority queues are not served as long as there are
higher-priority queues. Among queues in the same class, the
bandwidth is distributed in proportion to the weight of each
queue. A very thin extra bandwidth is however guaranteed to the Idle
class, to prevent it from starving.
- If the strict_guarantees parameter is set (default: unset), then BFQ
- always performs idling when the in-service queue becomes empty;
- forces the device to serve one I/O request at a time, by
dispatching a new request only if there is no outstanding
request.
In the presence of differentiated weights or I/O-request sizes,
both the above conditions are needed to guarantee that every
queue receives its allotted share of the bandwidth (see
Documentation/block/bfq-iosched.txt for more details). Setting
strict_guarantees may evidently affect throughput.
[1] https://lkml.org/lkml/2008/4/1/234
https://lkml.org/lkml/2008/11/11/148
[2] P. Valente and M. Andreolini, "Improving Application
Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of
the 5th Annual International Systems and Storage Conference
(SYSTOR '12), June 2012.
Slightly extended version:
http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite-
results.pdf
Signed-off-by: Fabio Checconi <fchecconi@gmail.com>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-19 14:29:02 +00:00
|
|
|
obj-$(CONFIG_IOSCHED_BFQ) += bfq-iosched.o
|
2006-03-23 19:00:26 +00:00
|
|
|
|
2007-10-12 10:50:41 +00:00
|
|
|
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
|
2013-09-30 20:45:19 +00:00
|
|
|
obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
|
2014-09-26 23:20:07 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
|
2016-09-19 05:50:16 +00:00
|
|
|
obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o
|
2017-02-05 17:15:24 +00:00
|
|
|
obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
|
2016-10-18 06:40:33 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
|
blk-wbt: add general throttling mechanism
We can hook this up to the block layer, to help throttle buffered
writes.
wbt registers a few trace points that can be used to track what is
happening in the system:
wbt_lat: 259:0: latency 2446318
wbt_stat: 259:0: rmean=2446318, rmin=2446318, rmax=2446318, rsamples=1,
wmean=518866, wmin=15522, wmax=5330353, wsamples=57
wbt_step: 259:0: step down: step=1, window=72727272, background=8, normal=16, max=32
This shows a sync issue event (wbt_lat) that exceeded it's time. wbt_stat
dumps the current read/write stats for that window, and wbt_step shows a
step down event where we now scale back writes. Each trace includes the
device, 259:0 in this case.
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-11-09 19:36:15 +00:00
|
|
|
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
|
2017-01-27 22:03:01 +00:00
|
|
|
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
|
2017-02-03 19:50:31 +00:00
|
|
|
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|