xref: /linux/Documentation/block/bfq-iosched.rst (revision 898bd37a)
1*898bd37aSMauro Carvalho Chehab==========================
2*898bd37aSMauro Carvalho ChehabBFQ (Budget Fair Queueing)
3*898bd37aSMauro Carvalho Chehab==========================
4*898bd37aSMauro Carvalho Chehab
5*898bd37aSMauro Carvalho ChehabBFQ is a proportional-share I/O scheduler, with some extra
6*898bd37aSMauro Carvalho Chehablow-latency capabilities. In addition to cgroups support (blkio or io
7*898bd37aSMauro Carvalho Chehabcontrollers), BFQ's main features are:
8*898bd37aSMauro Carvalho Chehab
9*898bd37aSMauro Carvalho Chehab- BFQ guarantees a high system and application responsiveness, and a
10*898bd37aSMauro Carvalho Chehab  low latency for time-sensitive applications, such as audio or video
11*898bd37aSMauro Carvalho Chehab  players;
12*898bd37aSMauro Carvalho Chehab- BFQ distributes bandwidth, and not just time, among processes or
13*898bd37aSMauro Carvalho Chehab  groups (switching back to time distribution when needed to keep
14*898bd37aSMauro Carvalho Chehab  throughput high).
15*898bd37aSMauro Carvalho Chehab
16*898bd37aSMauro Carvalho ChehabIn its default configuration, BFQ privileges latency over
17*898bd37aSMauro Carvalho Chehabthroughput. So, when needed for achieving a lower latency, BFQ builds
18*898bd37aSMauro Carvalho Chehabschedules that may lead to a lower throughput. If your main or only
19*898bd37aSMauro Carvalho Chehabgoal, for a given device, is to achieve the maximum-possible
20*898bd37aSMauro Carvalho Chehabthroughput at all times, then do switch off all low-latency heuristics
21*898bd37aSMauro Carvalho Chehabfor that device, by setting low_latency to 0. See Section 3 for
22*898bd37aSMauro Carvalho Chehabdetails on how to configure BFQ for the desired tradeoff between
23*898bd37aSMauro Carvalho Chehablatency and throughput, or on how to maximize throughput.
24*898bd37aSMauro Carvalho Chehab
25*898bd37aSMauro Carvalho ChehabAs every I/O scheduler, BFQ adds some overhead to per-I/O-request
26*898bd37aSMauro Carvalho Chehabprocessing. To give an idea of this overhead, the total,
27*898bd37aSMauro Carvalho Chehabsingle-lock-protected, per-request processing time of BFQ---i.e., the
28*898bd37aSMauro Carvalho Chehabsum of the execution times of the request insertion, dispatch and
29*898bd37aSMauro Carvalho Chehabcompletion hooks---is, e.g., 1.9 us on an Intel Core i7-2760QM@2.40GHz
30*898bd37aSMauro Carvalho Chehab(dated CPU for notebooks; time measured with simple code
31*898bd37aSMauro Carvalho Chehabinstrumentation, and using the throughput-sync.sh script of the S
32*898bd37aSMauro Carvalho Chehabsuite [1], in performance-profiling mode). To put this result into
33*898bd37aSMauro Carvalho Chehabcontext, the total, single-lock-protected, per-request execution time
34*898bd37aSMauro Carvalho Chehabof the lightest I/O scheduler available in blk-mq, mq-deadline, is 0.7
35*898bd37aSMauro Carvalho Chehabus (mq-deadline is ~800 LOC, against ~10500 LOC for BFQ).
36*898bd37aSMauro Carvalho Chehab
37*898bd37aSMauro Carvalho ChehabScheduling overhead further limits the maximum IOPS that a CPU can
38*898bd37aSMauro Carvalho Chehabprocess (already limited by the execution of the rest of the I/O
39*898bd37aSMauro Carvalho Chehabstack). To give an idea of the limits with BFQ, on slow or average
40*898bd37aSMauro Carvalho ChehabCPUs, here are, first, the limits of BFQ for three different CPUs, on,
41*898bd37aSMauro Carvalho Chehabrespectively, an average laptop, an old desktop, and a cheap embedded
42*898bd37aSMauro Carvalho Chehabsystem, in case full hierarchical support is enabled (i.e.,
43*898bd37aSMauro Carvalho ChehabCONFIG_BFQ_GROUP_IOSCHED is set), but CONFIG_BFQ_CGROUP_DEBUG is not
44*898bd37aSMauro Carvalho Chehabset (Section 4-2):
45*898bd37aSMauro Carvalho Chehab- Intel i7-4850HQ: 400 KIOPS
46*898bd37aSMauro Carvalho Chehab- AMD A8-3850: 250 KIOPS
47*898bd37aSMauro Carvalho Chehab- ARM CortexTM-A53 Octa-core: 80 KIOPS
48*898bd37aSMauro Carvalho Chehab
49*898bd37aSMauro Carvalho ChehabIf CONFIG_BFQ_CGROUP_DEBUG is set (and of course full hierarchical
50*898bd37aSMauro Carvalho Chehabsupport is enabled), then the sustainable throughput with BFQ
51*898bd37aSMauro Carvalho Chehabdecreases, because all blkio.bfq* statistics are created and updated
52*898bd37aSMauro Carvalho Chehab(Section 4-2). For BFQ, this leads to the following maximum
53*898bd37aSMauro Carvalho Chehabsustainable throughputs, on the same systems as above:
54*898bd37aSMauro Carvalho Chehab- Intel i7-4850HQ: 310 KIOPS
55*898bd37aSMauro Carvalho Chehab- AMD A8-3850: 200 KIOPS
56*898bd37aSMauro Carvalho Chehab- ARM CortexTM-A53 Octa-core: 56 KIOPS
57*898bd37aSMauro Carvalho Chehab
58*898bd37aSMauro Carvalho ChehabBFQ works for multi-queue devices too.
59*898bd37aSMauro Carvalho Chehab
60*898bd37aSMauro Carvalho Chehab.. The table of contents follow. Impatients can just jump to Section 3.
61*898bd37aSMauro Carvalho Chehab
62*898bd37aSMauro Carvalho Chehab.. CONTENTS
63*898bd37aSMauro Carvalho Chehab
64*898bd37aSMauro Carvalho Chehab   1. When may BFQ be useful?
65*898bd37aSMauro Carvalho Chehab    1-1 Personal systems
66*898bd37aSMauro Carvalho Chehab    1-2 Server systems
67*898bd37aSMauro Carvalho Chehab   2. How does BFQ work?
68*898bd37aSMauro Carvalho Chehab   3. What are BFQ's tunables and how to properly configure BFQ?
69*898bd37aSMauro Carvalho Chehab   4. BFQ group scheduling
70*898bd37aSMauro Carvalho Chehab    4-1 Service guarantees provided
71*898bd37aSMauro Carvalho Chehab    4-2 Interface
72*898bd37aSMauro Carvalho Chehab
73*898bd37aSMauro Carvalho Chehab1. When may BFQ be useful?
74*898bd37aSMauro Carvalho Chehab==========================
75*898bd37aSMauro Carvalho Chehab
76*898bd37aSMauro Carvalho ChehabBFQ provides the following benefits on personal and server systems.
77*898bd37aSMauro Carvalho Chehab
78*898bd37aSMauro Carvalho Chehab1-1 Personal systems
79*898bd37aSMauro Carvalho Chehab--------------------
80*898bd37aSMauro Carvalho Chehab
81*898bd37aSMauro Carvalho ChehabLow latency for interactive applications
82*898bd37aSMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83*898bd37aSMauro Carvalho Chehab
84*898bd37aSMauro Carvalho ChehabRegardless of the actual background workload, BFQ guarantees that, for
85*898bd37aSMauro Carvalho Chehabinteractive tasks, the storage device is virtually as responsive as if
86*898bd37aSMauro Carvalho Chehabit was idle. For example, even if one or more of the following
87*898bd37aSMauro Carvalho Chehabbackground workloads are being executed:
88*898bd37aSMauro Carvalho Chehab
89*898bd37aSMauro Carvalho Chehab- one or more large files are being read, written or copied,
90*898bd37aSMauro Carvalho Chehab- a tree of source files is being compiled,
91*898bd37aSMauro Carvalho Chehab- one or more virtual machines are performing I/O,
92*898bd37aSMauro Carvalho Chehab- a software update is in progress,
93*898bd37aSMauro Carvalho Chehab- indexing daemons are scanning filesystems and updating their
94*898bd37aSMauro Carvalho Chehab  databases,
95*898bd37aSMauro Carvalho Chehab
96*898bd37aSMauro Carvalho Chehabstarting an application or loading a file from within an application
97*898bd37aSMauro Carvalho Chehabtakes about the same time as if the storage device was idle. As a
98*898bd37aSMauro Carvalho Chehabcomparison, with CFQ, NOOP or DEADLINE, and in the same conditions,
99*898bd37aSMauro Carvalho Chehabapplications experience high latencies, or even become unresponsive
100*898bd37aSMauro Carvalho Chehabuntil the background workload terminates (also on SSDs).
101*898bd37aSMauro Carvalho Chehab
102*898bd37aSMauro Carvalho ChehabLow latency for soft real-time applications
103*898bd37aSMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104*898bd37aSMauro Carvalho ChehabAlso soft real-time applications, such as audio and video
105*898bd37aSMauro Carvalho Chehabplayers/streamers, enjoy a low latency and a low drop rate, regardless
106*898bd37aSMauro Carvalho Chehabof the background I/O workload. As a consequence, these applications
107*898bd37aSMauro Carvalho Chehabdo not suffer from almost any glitch due to the background workload.
108*898bd37aSMauro Carvalho Chehab
109*898bd37aSMauro Carvalho ChehabHigher speed for code-development tasks
110*898bd37aSMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111*898bd37aSMauro Carvalho Chehab
112*898bd37aSMauro Carvalho ChehabIf some additional workload happens to be executed in parallel, then
113*898bd37aSMauro Carvalho ChehabBFQ executes the I/O-related components of typical code-development
114*898bd37aSMauro Carvalho Chehabtasks (compilation, checkout, merge, ...) much more quickly than CFQ,
115*898bd37aSMauro Carvalho ChehabNOOP or DEADLINE.
116*898bd37aSMauro Carvalho Chehab
117*898bd37aSMauro Carvalho ChehabHigh throughput
118*898bd37aSMauro Carvalho Chehab^^^^^^^^^^^^^^^
119*898bd37aSMauro Carvalho Chehab
120*898bd37aSMauro Carvalho ChehabOn hard disks, BFQ achieves up to 30% higher throughput than CFQ, and
121*898bd37aSMauro Carvalho Chehabup to 150% higher throughput than DEADLINE and NOOP, with all the
122*898bd37aSMauro Carvalho Chehabsequential workloads considered in our tests. With random workloads,
123*898bd37aSMauro Carvalho Chehaband with all the workloads on flash-based devices, BFQ achieves,
124*898bd37aSMauro Carvalho Chehabinstead, about the same throughput as the other schedulers.
125*898bd37aSMauro Carvalho Chehab
126*898bd37aSMauro Carvalho ChehabStrong fairness, bandwidth and delay guarantees
127*898bd37aSMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128*898bd37aSMauro Carvalho Chehab
129*898bd37aSMauro Carvalho ChehabBFQ distributes the device throughput, and not just the device time,
130*898bd37aSMauro Carvalho Chehabamong I/O-bound applications in proportion their weights, with any
131*898bd37aSMauro Carvalho Chehabworkload and regardless of the device parameters. From these bandwidth
132*898bd37aSMauro Carvalho Chehabguarantees, it is possible to compute tight per-I/O-request delay
133*898bd37aSMauro Carvalho Chehabguarantees by a simple formula. If not configured for strict service
134*898bd37aSMauro Carvalho Chehabguarantees, BFQ switches to time-based resource sharing (only) for
135*898bd37aSMauro Carvalho Chehabapplications that would otherwise cause a throughput loss.
136*898bd37aSMauro Carvalho Chehab
137*898bd37aSMauro Carvalho Chehab1-2 Server systems
138*898bd37aSMauro Carvalho Chehab------------------
139*898bd37aSMauro Carvalho Chehab
140*898bd37aSMauro Carvalho ChehabMost benefits for server systems follow from the same service
141*898bd37aSMauro Carvalho Chehabproperties as above. In particular, regardless of whether additional,
142*898bd37aSMauro Carvalho Chehabpossibly heavy workloads are being served, BFQ guarantees:
143*898bd37aSMauro Carvalho Chehab
144*898bd37aSMauro Carvalho Chehab* audio and video-streaming with zero or very low jitter and drop
145*898bd37aSMauro Carvalho Chehab  rate;
146*898bd37aSMauro Carvalho Chehab
147*898bd37aSMauro Carvalho Chehab* fast retrieval of WEB pages and embedded objects;
148*898bd37aSMauro Carvalho Chehab
149*898bd37aSMauro Carvalho Chehab* real-time recording of data in live-dumping applications (e.g.,
150*898bd37aSMauro Carvalho Chehab  packet logging);
151*898bd37aSMauro Carvalho Chehab
152*898bd37aSMauro Carvalho Chehab* responsiveness in local and remote access to a server.
153*898bd37aSMauro Carvalho Chehab
154*898bd37aSMauro Carvalho Chehab
155*898bd37aSMauro Carvalho Chehab2. How does BFQ work?
156*898bd37aSMauro Carvalho Chehab=====================
157*898bd37aSMauro Carvalho Chehab
158*898bd37aSMauro Carvalho ChehabBFQ is a proportional-share I/O scheduler, whose general structure,
159*898bd37aSMauro Carvalho Chehabplus a lot of code, are borrowed from CFQ.
160*898bd37aSMauro Carvalho Chehab
161*898bd37aSMauro Carvalho Chehab- Each process doing I/O on a device is associated with a weight and a
162*898bd37aSMauro Carvalho Chehab  `(bfq_)queue`.
163*898bd37aSMauro Carvalho Chehab
164*898bd37aSMauro Carvalho Chehab- BFQ grants exclusive access to the device, for a while, to one queue
165*898bd37aSMauro Carvalho Chehab  (process) at a time, and implements this service model by
166*898bd37aSMauro Carvalho Chehab  associating every queue with a budget, measured in number of
167*898bd37aSMauro Carvalho Chehab  sectors.
168*898bd37aSMauro Carvalho Chehab
169*898bd37aSMauro Carvalho Chehab  - After a queue is granted access to the device, the budget of the
170*898bd37aSMauro Carvalho Chehab    queue is decremented, on each request dispatch, by the size of the
171*898bd37aSMauro Carvalho Chehab    request.
172*898bd37aSMauro Carvalho Chehab
173*898bd37aSMauro Carvalho Chehab  - The in-service queue is expired, i.e., its service is suspended,
174*898bd37aSMauro Carvalho Chehab    only if one of the following events occurs: 1) the queue finishes
175*898bd37aSMauro Carvalho Chehab    its budget, 2) the queue empties, 3) a "budget timeout" fires.
176*898bd37aSMauro Carvalho Chehab
177*898bd37aSMauro Carvalho Chehab    - The budget timeout prevents processes doing random I/O from
178*898bd37aSMauro Carvalho Chehab      holding the device for too long and dramatically reducing
179*898bd37aSMauro Carvalho Chehab      throughput.
180*898bd37aSMauro Carvalho Chehab
181*898bd37aSMauro Carvalho Chehab    - Actually, as in CFQ, a queue associated with a process issuing
182*898bd37aSMauro Carvalho Chehab      sync requests may not be expired immediately when it empties. In
183*898bd37aSMauro Carvalho Chehab      contrast, BFQ may idle the device for a short time interval,
184*898bd37aSMauro Carvalho Chehab      giving the process the chance to go on being served if it issues
185*898bd37aSMauro Carvalho Chehab      a new request in time. Device idling typically boosts the
186*898bd37aSMauro Carvalho Chehab      throughput on rotational devices and on non-queueing flash-based
187*898bd37aSMauro Carvalho Chehab      devices, if processes do synchronous and sequential I/O. In
188*898bd37aSMauro Carvalho Chehab      addition, under BFQ, device idling is also instrumental in
189*898bd37aSMauro Carvalho Chehab      guaranteeing the desired throughput fraction to processes
190*898bd37aSMauro Carvalho Chehab      issuing sync requests (see the description of the slice_idle
191*898bd37aSMauro Carvalho Chehab      tunable in this document, or [1, 2], for more details).
192*898bd37aSMauro Carvalho Chehab
193*898bd37aSMauro Carvalho Chehab      - With respect to idling for service guarantees, if several
194*898bd37aSMauro Carvalho Chehab	processes are competing for the device at the same time, but
195*898bd37aSMauro Carvalho Chehab	all processes and groups have the same weight, then BFQ
196*898bd37aSMauro Carvalho Chehab	guarantees the expected throughput distribution without ever
197*898bd37aSMauro Carvalho Chehab	idling the device. Throughput is thus as high as possible in
198*898bd37aSMauro Carvalho Chehab	this common scenario.
199*898bd37aSMauro Carvalho Chehab
200*898bd37aSMauro Carvalho Chehab     - On flash-based storage with internal queueing of commands
201*898bd37aSMauro Carvalho Chehab       (typically NCQ), device idling happens to be always detrimental
202*898bd37aSMauro Carvalho Chehab       for throughput. So, with these devices, BFQ performs idling
203*898bd37aSMauro Carvalho Chehab       only when strictly needed for service guarantees, i.e., for
204*898bd37aSMauro Carvalho Chehab       guaranteeing low latency or fairness. In these cases, overall
205*898bd37aSMauro Carvalho Chehab       throughput may be sub-optimal. No solution currently exists to
206*898bd37aSMauro Carvalho Chehab       provide both strong service guarantees and optimal throughput
207*898bd37aSMauro Carvalho Chehab       on devices with internal queueing.
208*898bd37aSMauro Carvalho Chehab
209*898bd37aSMauro Carvalho Chehab  - If low-latency mode is enabled (default configuration), BFQ
210*898bd37aSMauro Carvalho Chehab    executes some special heuristics to detect interactive and soft
211*898bd37aSMauro Carvalho Chehab    real-time applications (e.g., video or audio players/streamers),
212*898bd37aSMauro Carvalho Chehab    and to reduce their latency. The most important action taken to
213*898bd37aSMauro Carvalho Chehab    achieve this goal is to give to the queues associated with these
214*898bd37aSMauro Carvalho Chehab    applications more than their fair share of the device
215*898bd37aSMauro Carvalho Chehab    throughput. For brevity, we call just "weight-raising" the whole
216*898bd37aSMauro Carvalho Chehab    sets of actions taken by BFQ to privilege these queues. In
217*898bd37aSMauro Carvalho Chehab    particular, BFQ provides a milder form of weight-raising for
218*898bd37aSMauro Carvalho Chehab    interactive applications, and a stronger form for soft real-time
219*898bd37aSMauro Carvalho Chehab    applications.
220*898bd37aSMauro Carvalho Chehab
221*898bd37aSMauro Carvalho Chehab  - BFQ automatically deactivates idling for queues born in a burst of
222*898bd37aSMauro Carvalho Chehab    queue creations. In fact, these queues are usually associated with
223*898bd37aSMauro Carvalho Chehab    the processes of applications and services that benefit mostly
224*898bd37aSMauro Carvalho Chehab    from a high throughput. Examples are systemd during boot, or git
225*898bd37aSMauro Carvalho Chehab    grep.
226*898bd37aSMauro Carvalho Chehab
227*898bd37aSMauro Carvalho Chehab  - As CFQ, BFQ merges queues performing interleaved I/O, i.e.,
228*898bd37aSMauro Carvalho Chehab    performing random I/O that becomes mostly sequential if
229*898bd37aSMauro Carvalho Chehab    merged. Differently from CFQ, BFQ achieves this goal with a more
230*898bd37aSMauro Carvalho Chehab    reactive mechanism, called Early Queue Merge (EQM). EQM is so
231*898bd37aSMauro Carvalho Chehab    responsive in detecting interleaved I/O (cooperating processes),
232*898bd37aSMauro Carvalho Chehab    that it enables BFQ to achieve a high throughput, by queue
233*898bd37aSMauro Carvalho Chehab    merging, even for queues for which CFQ needs a different
234*898bd37aSMauro Carvalho Chehab    mechanism, preemption, to get a high throughput. As such EQM is a
235*898bd37aSMauro Carvalho Chehab    unified mechanism to achieve a high throughput with interleaved
236*898bd37aSMauro Carvalho Chehab    I/O.
237*898bd37aSMauro Carvalho Chehab
238*898bd37aSMauro Carvalho Chehab  - Queues are scheduled according to a variant of WF2Q+, named
239*898bd37aSMauro Carvalho Chehab    B-WF2Q+, and implemented using an augmented rb-tree to preserve an
240*898bd37aSMauro Carvalho Chehab    O(log N) overall complexity.  See [2] for more details. B-WF2Q+ is
241*898bd37aSMauro Carvalho Chehab    also ready for hierarchical scheduling, details in Section 4.
242*898bd37aSMauro Carvalho Chehab
243*898bd37aSMauro Carvalho Chehab  - B-WF2Q+ guarantees a tight deviation with respect to an ideal,
244*898bd37aSMauro Carvalho Chehab    perfectly fair, and smooth service. In particular, B-WF2Q+
245*898bd37aSMauro Carvalho Chehab    guarantees that each queue receives a fraction of the device
246*898bd37aSMauro Carvalho Chehab    throughput proportional to its weight, even if the throughput
247*898bd37aSMauro Carvalho Chehab    fluctuates, and regardless of: the device parameters, the current
248*898bd37aSMauro Carvalho Chehab    workload and the budgets assigned to the queue.
249*898bd37aSMauro Carvalho Chehab
250*898bd37aSMauro Carvalho Chehab  - The last, budget-independence, property (although probably
251*898bd37aSMauro Carvalho Chehab    counterintuitive in the first place) is definitely beneficial, for
252*898bd37aSMauro Carvalho Chehab    the following reasons:
253*898bd37aSMauro Carvalho Chehab
254*898bd37aSMauro Carvalho Chehab    - First, with any proportional-share scheduler, the maximum
255*898bd37aSMauro Carvalho Chehab      deviation with respect to an ideal service is proportional to
256*898bd37aSMauro Carvalho Chehab      the maximum budget (slice) assigned to queues. As a consequence,
257*898bd37aSMauro Carvalho Chehab      BFQ can keep this deviation tight not only because of the
258*898bd37aSMauro Carvalho Chehab      accurate service of B-WF2Q+, but also because BFQ *does not*
259*898bd37aSMauro Carvalho Chehab      need to assign a larger budget to a queue to let the queue
260*898bd37aSMauro Carvalho Chehab      receive a higher fraction of the device throughput.
261*898bd37aSMauro Carvalho Chehab
262*898bd37aSMauro Carvalho Chehab    - Second, BFQ is free to choose, for every process (queue), the
263*898bd37aSMauro Carvalho Chehab      budget that best fits the needs of the process, or best
264*898bd37aSMauro Carvalho Chehab      leverages the I/O pattern of the process. In particular, BFQ
265*898bd37aSMauro Carvalho Chehab      updates queue budgets with a simple feedback-loop algorithm that
266*898bd37aSMauro Carvalho Chehab      allows a high throughput to be achieved, while still providing
267*898bd37aSMauro Carvalho Chehab      tight latency guarantees to time-sensitive applications. When
268*898bd37aSMauro Carvalho Chehab      the in-service queue expires, this algorithm computes the next
269*898bd37aSMauro Carvalho Chehab      budget of the queue so as to:
270*898bd37aSMauro Carvalho Chehab
271*898bd37aSMauro Carvalho Chehab      - Let large budgets be eventually assigned to the queues
272*898bd37aSMauro Carvalho Chehab	associated with I/O-bound applications performing sequential
273*898bd37aSMauro Carvalho Chehab	I/O: in fact, the longer these applications are served once
274*898bd37aSMauro Carvalho Chehab	got access to the device, the higher the throughput is.
275*898bd37aSMauro Carvalho Chehab
276*898bd37aSMauro Carvalho Chehab      - Let small budgets be eventually assigned to the queues
277*898bd37aSMauro Carvalho Chehab	associated with time-sensitive applications (which typically
278*898bd37aSMauro Carvalho Chehab	perform sporadic and short I/O), because, the smaller the
279*898bd37aSMauro Carvalho Chehab	budget assigned to a queue waiting for service is, the sooner
280*898bd37aSMauro Carvalho Chehab	B-WF2Q+ will serve that queue (Subsec 3.3 in [2]).
281*898bd37aSMauro Carvalho Chehab
282*898bd37aSMauro Carvalho Chehab- If several processes are competing for the device at the same time,
283*898bd37aSMauro Carvalho Chehab  but all processes and groups have the same weight, then BFQ
284*898bd37aSMauro Carvalho Chehab  guarantees the expected throughput distribution without ever idling
285*898bd37aSMauro Carvalho Chehab  the device. It uses preemption instead. Throughput is then much
286*898bd37aSMauro Carvalho Chehab  higher in this common scenario.
287*898bd37aSMauro Carvalho Chehab
288*898bd37aSMauro Carvalho Chehab- ioprio classes are served in strict priority order, i.e.,
289*898bd37aSMauro Carvalho Chehab  lower-priority queues are not served as long as there are
290*898bd37aSMauro Carvalho Chehab  higher-priority queues.  Among queues in the same class, the
291*898bd37aSMauro Carvalho Chehab  bandwidth is distributed in proportion to the weight of each
292*898bd37aSMauro Carvalho Chehab  queue. A very thin extra bandwidth is however guaranteed to
293*898bd37aSMauro Carvalho Chehab  the Idle class, to prevent it from starving.
294*898bd37aSMauro Carvalho Chehab
295*898bd37aSMauro Carvalho Chehab
296*898bd37aSMauro Carvalho Chehab3. What are BFQ's tunables and how to properly configure BFQ?
297*898bd37aSMauro Carvalho Chehab=============================================================
298*898bd37aSMauro Carvalho Chehab
299*898bd37aSMauro Carvalho ChehabMost BFQ tunables affect service guarantees (basically latency and
300*898bd37aSMauro Carvalho Chehabfairness) and throughput. For full details on how to choose the
301*898bd37aSMauro Carvalho Chehabdesired tradeoff between service guarantees and throughput, see the
302*898bd37aSMauro Carvalho Chehabparameters slice_idle, strict_guarantees and low_latency. For details
303*898bd37aSMauro Carvalho Chehabon how to maximise throughput, see slice_idle, timeout_sync and
304*898bd37aSMauro Carvalho Chehabmax_budget. The other performance-related parameters have been
305*898bd37aSMauro Carvalho Chehabinherited from, and have been preserved mostly for compatibility with
306*898bd37aSMauro Carvalho ChehabCFQ. So far, no performance improvement has been reported after
307*898bd37aSMauro Carvalho Chehabchanging the latter parameters in BFQ.
308*898bd37aSMauro Carvalho Chehab
309*898bd37aSMauro Carvalho ChehabIn particular, the tunables back_seek-max, back_seek_penalty,
310*898bd37aSMauro Carvalho Chehabfifo_expire_async and fifo_expire_sync below are the same as in
311*898bd37aSMauro Carvalho ChehabCFQ. Their description is just copied from that for CFQ. Some
312*898bd37aSMauro Carvalho Chehabconsiderations in the description of slice_idle are copied from CFQ
313*898bd37aSMauro Carvalho Chehabtoo.
314*898bd37aSMauro Carvalho Chehab
315*898bd37aSMauro Carvalho Chehabper-process ioprio and weight
316*898bd37aSMauro Carvalho Chehab-----------------------------
317*898bd37aSMauro Carvalho Chehab
318*898bd37aSMauro Carvalho ChehabUnless the cgroups interface is used (see "4. BFQ group scheduling"),
319*898bd37aSMauro Carvalho Chehabweights can be assigned to processes only indirectly, through I/O
320*898bd37aSMauro Carvalho Chehabpriorities, and according to the relation:
321*898bd37aSMauro Carvalho Chehabweight = (IOPRIO_BE_NR - ioprio) * 10.
322*898bd37aSMauro Carvalho Chehab
323*898bd37aSMauro Carvalho ChehabBeware that, if low-latency is set, then BFQ automatically raises the
324*898bd37aSMauro Carvalho Chehabweight of the queues associated with interactive and soft real-time
325*898bd37aSMauro Carvalho Chehabapplications. Unset this tunable if you need/want to control weights.
326*898bd37aSMauro Carvalho Chehab
327*898bd37aSMauro Carvalho Chehabslice_idle
328*898bd37aSMauro Carvalho Chehab----------
329*898bd37aSMauro Carvalho Chehab
330*898bd37aSMauro Carvalho ChehabThis parameter specifies how long BFQ should idle for next I/O
331*898bd37aSMauro Carvalho Chehabrequest, when certain sync BFQ queues become empty. By default
332*898bd37aSMauro Carvalho Chehabslice_idle is a non-zero value. Idling has a double purpose: boosting
333*898bd37aSMauro Carvalho Chehabthroughput and making sure that the desired throughput distribution is
334*898bd37aSMauro Carvalho Chehabrespected (see the description of how BFQ works, and, if needed, the
335*898bd37aSMauro Carvalho Chehabpapers referred there).
336*898bd37aSMauro Carvalho Chehab
337*898bd37aSMauro Carvalho ChehabAs for throughput, idling can be very helpful on highly seeky media
338*898bd37aSMauro Carvalho Chehablike single spindle SATA/SAS disks where we can cut down on overall
339*898bd37aSMauro Carvalho Chehabnumber of seeks and see improved throughput.
340*898bd37aSMauro Carvalho Chehab
341*898bd37aSMauro Carvalho ChehabSetting slice_idle to 0 will remove all the idling on queues and one
342*898bd37aSMauro Carvalho Chehabshould see an overall improved throughput on faster storage devices
343*898bd37aSMauro Carvalho Chehablike multiple SATA/SAS disks in hardware RAID configuration, as well
344*898bd37aSMauro Carvalho Chehabas flash-based storage with internal command queueing (and
345*898bd37aSMauro Carvalho Chehabparallelism).
346*898bd37aSMauro Carvalho Chehab
347*898bd37aSMauro Carvalho ChehabSo depending on storage and workload, it might be useful to set
348*898bd37aSMauro Carvalho Chehabslice_idle=0.  In general for SATA/SAS disks and software RAID of
349*898bd37aSMauro Carvalho ChehabSATA/SAS disks keeping slice_idle enabled should be useful. For any
350*898bd37aSMauro Carvalho Chehabconfigurations where there are multiple spindles behind single LUN
351*898bd37aSMauro Carvalho Chehab(Host based hardware RAID controller or for storage arrays), or with
352*898bd37aSMauro Carvalho Chehabflash-based fast storage, setting slice_idle=0 might end up in better
353*898bd37aSMauro Carvalho Chehabthroughput and acceptable latencies.
354*898bd37aSMauro Carvalho Chehab
355*898bd37aSMauro Carvalho ChehabIdling is however necessary to have service guarantees enforced in
356*898bd37aSMauro Carvalho Chehabcase of differentiated weights or differentiated I/O-request lengths.
357*898bd37aSMauro Carvalho ChehabTo see why, suppose that a given BFQ queue A must get several I/O
358*898bd37aSMauro Carvalho Chehabrequests served for each request served for another queue B. Idling
359*898bd37aSMauro Carvalho Chehabensures that, if A makes a new I/O request slightly after becoming
360*898bd37aSMauro Carvalho Chehabempty, then no request of B is dispatched in the middle, and thus A
361*898bd37aSMauro Carvalho Chehabdoes not lose the possibility to get more than one request dispatched
362*898bd37aSMauro Carvalho Chehabbefore the next request of B is dispatched. Note that idling
363*898bd37aSMauro Carvalho Chehabguarantees the desired differentiated treatment of queues only in
364*898bd37aSMauro Carvalho Chehabterms of I/O-request dispatches. To guarantee that the actual service
365*898bd37aSMauro Carvalho Chehaborder then corresponds to the dispatch order, the strict_guarantees
366*898bd37aSMauro Carvalho Chehabtunable must be set too.
367*898bd37aSMauro Carvalho Chehab
368*898bd37aSMauro Carvalho ChehabThere is an important flipside for idling: apart from the above cases
369*898bd37aSMauro Carvalho Chehabwhere it is beneficial also for throughput, idling can severely impact
370*898bd37aSMauro Carvalho Chehabthroughput. One important case is random workload. Because of this
371*898bd37aSMauro Carvalho Chehabissue, BFQ tends to avoid idling as much as possible, when it is not
372*898bd37aSMauro Carvalho Chehabbeneficial also for throughput (as detailed in Section 2). As a
373*898bd37aSMauro Carvalho Chehabconsequence of this behavior, and of further issues described for the
374*898bd37aSMauro Carvalho Chehabstrict_guarantees tunable, short-term service guarantees may be
375*898bd37aSMauro Carvalho Chehaboccasionally violated. And, in some cases, these guarantees may be
376*898bd37aSMauro Carvalho Chehabmore important than guaranteeing maximum throughput. For example, in
377*898bd37aSMauro Carvalho Chehabvideo playing/streaming, a very low drop rate may be more important
378*898bd37aSMauro Carvalho Chehabthan maximum throughput. In these cases, consider setting the
379*898bd37aSMauro Carvalho Chehabstrict_guarantees parameter.
380*898bd37aSMauro Carvalho Chehab
381*898bd37aSMauro Carvalho Chehabslice_idle_us
382*898bd37aSMauro Carvalho Chehab-------------
383*898bd37aSMauro Carvalho Chehab
384*898bd37aSMauro Carvalho ChehabControls the same tuning parameter as slice_idle, but in microseconds.
385*898bd37aSMauro Carvalho ChehabEither tunable can be used to set idling behavior.  Afterwards, the
386*898bd37aSMauro Carvalho Chehabother tunable will reflect the newly set value in sysfs.
387*898bd37aSMauro Carvalho Chehab
388*898bd37aSMauro Carvalho Chehabstrict_guarantees
389*898bd37aSMauro Carvalho Chehab-----------------
390*898bd37aSMauro Carvalho Chehab
391*898bd37aSMauro Carvalho ChehabIf this parameter is set (default: unset), then BFQ
392*898bd37aSMauro Carvalho Chehab
393*898bd37aSMauro Carvalho Chehab- always performs idling when the in-service queue becomes empty;
394*898bd37aSMauro Carvalho Chehab
395*898bd37aSMauro Carvalho Chehab- forces the device to serve one I/O request at a time, by dispatching a
396*898bd37aSMauro Carvalho Chehab  new request only if there is no outstanding request.
397*898bd37aSMauro Carvalho Chehab
398*898bd37aSMauro Carvalho ChehabIn the presence of differentiated weights or I/O-request sizes, both
399*898bd37aSMauro Carvalho Chehabthe above conditions are needed to guarantee that every BFQ queue
400*898bd37aSMauro Carvalho Chehabreceives its allotted share of the bandwidth. The first condition is
401*898bd37aSMauro Carvalho Chehabneeded for the reasons explained in the description of the slice_idle
402*898bd37aSMauro Carvalho Chehabtunable.  The second condition is needed because all modern storage
403*898bd37aSMauro Carvalho Chehabdevices reorder internally-queued requests, which may trivially break
404*898bd37aSMauro Carvalho Chehabthe service guarantees enforced by the I/O scheduler.
405*898bd37aSMauro Carvalho Chehab
406*898bd37aSMauro Carvalho ChehabSetting strict_guarantees may evidently affect throughput.
407*898bd37aSMauro Carvalho Chehab
408*898bd37aSMauro Carvalho Chehabback_seek_max
409*898bd37aSMauro Carvalho Chehab-------------
410*898bd37aSMauro Carvalho Chehab
411*898bd37aSMauro Carvalho ChehabThis specifies, given in Kbytes, the maximum "distance" for backward seeking.
412*898bd37aSMauro Carvalho ChehabThe distance is the amount of space from the current head location to the
413*898bd37aSMauro Carvalho Chehabsectors that are backward in terms of distance.
414*898bd37aSMauro Carvalho Chehab
415*898bd37aSMauro Carvalho ChehabThis parameter allows the scheduler to anticipate requests in the "backward"
416*898bd37aSMauro Carvalho Chehabdirection and consider them as being the "next" if they are within this
417*898bd37aSMauro Carvalho Chehabdistance from the current head location.
418*898bd37aSMauro Carvalho Chehab
419*898bd37aSMauro Carvalho Chehabback_seek_penalty
420*898bd37aSMauro Carvalho Chehab-----------------
421*898bd37aSMauro Carvalho Chehab
422*898bd37aSMauro Carvalho ChehabThis parameter is used to compute the cost of backward seeking. If the
423*898bd37aSMauro Carvalho Chehabbackward distance of request is just 1/back_seek_penalty from a "front"
424*898bd37aSMauro Carvalho Chehabrequest, then the seeking cost of two requests is considered equivalent.
425*898bd37aSMauro Carvalho Chehab
426*898bd37aSMauro Carvalho ChehabSo scheduler will not bias toward one or the other request (otherwise scheduler
427*898bd37aSMauro Carvalho Chehabwill bias toward front request). Default value of back_seek_penalty is 2.
428*898bd37aSMauro Carvalho Chehab
429*898bd37aSMauro Carvalho Chehabfifo_expire_async
430*898bd37aSMauro Carvalho Chehab-----------------
431*898bd37aSMauro Carvalho Chehab
432*898bd37aSMauro Carvalho ChehabThis parameter is used to set the timeout of asynchronous requests. Default
433*898bd37aSMauro Carvalho Chehabvalue of this is 248ms.
434*898bd37aSMauro Carvalho Chehab
435*898bd37aSMauro Carvalho Chehabfifo_expire_sync
436*898bd37aSMauro Carvalho Chehab----------------
437*898bd37aSMauro Carvalho Chehab
438*898bd37aSMauro Carvalho ChehabThis parameter is used to set the timeout of synchronous requests. Default
439*898bd37aSMauro Carvalho Chehabvalue of this is 124ms. In case to favor synchronous requests over asynchronous
440*898bd37aSMauro Carvalho Chehabone, this value should be decreased relative to fifo_expire_async.
441*898bd37aSMauro Carvalho Chehab
442*898bd37aSMauro Carvalho Chehablow_latency
443*898bd37aSMauro Carvalho Chehab-----------
444*898bd37aSMauro Carvalho Chehab
445*898bd37aSMauro Carvalho ChehabThis parameter is used to enable/disable BFQ's low latency mode. By
446*898bd37aSMauro Carvalho Chehabdefault, low latency mode is enabled. If enabled, interactive and soft
447*898bd37aSMauro Carvalho Chehabreal-time applications are privileged and experience a lower latency,
448*898bd37aSMauro Carvalho Chehabas explained in more detail in the description of how BFQ works.
449*898bd37aSMauro Carvalho Chehab
450*898bd37aSMauro Carvalho ChehabDISABLE this mode if you need full control on bandwidth
451*898bd37aSMauro Carvalho Chehabdistribution. In fact, if it is enabled, then BFQ automatically
452*898bd37aSMauro Carvalho Chehabincreases the bandwidth share of privileged applications, as the main
453*898bd37aSMauro Carvalho Chehabmeans to guarantee a lower latency to them.
454*898bd37aSMauro Carvalho Chehab
455*898bd37aSMauro Carvalho ChehabIn addition, as already highlighted at the beginning of this document,
456*898bd37aSMauro Carvalho ChehabDISABLE this mode if your only goal is to achieve a high throughput.
457*898bd37aSMauro Carvalho ChehabIn fact, privileging the I/O of some application over the rest may
458*898bd37aSMauro Carvalho Chehabentail a lower throughput. To achieve the highest-possible throughput
459*898bd37aSMauro Carvalho Chehabon a non-rotational device, setting slice_idle to 0 may be needed too
460*898bd37aSMauro Carvalho Chehab(at the cost of giving up any strong guarantee on fairness and low
461*898bd37aSMauro Carvalho Chehablatency).
462*898bd37aSMauro Carvalho Chehab
463*898bd37aSMauro Carvalho Chehabtimeout_sync
464*898bd37aSMauro Carvalho Chehab------------
465*898bd37aSMauro Carvalho Chehab
466*898bd37aSMauro Carvalho ChehabMaximum amount of device time that can be given to a task (queue) once
467*898bd37aSMauro Carvalho Chehabit has been selected for service. On devices with costly seeks,
468*898bd37aSMauro Carvalho Chehabincreasing this time usually increases maximum throughput. On the
469*898bd37aSMauro Carvalho Chehabopposite end, increasing this time coarsens the granularity of the
470*898bd37aSMauro Carvalho Chehabshort-term bandwidth and latency guarantees, especially if the
471*898bd37aSMauro Carvalho Chehabfollowing parameter is set to zero.
472*898bd37aSMauro Carvalho Chehab
473*898bd37aSMauro Carvalho Chehabmax_budget
474*898bd37aSMauro Carvalho Chehab----------
475*898bd37aSMauro Carvalho Chehab
476*898bd37aSMauro Carvalho ChehabMaximum amount of service, measured in sectors, that can be provided
477*898bd37aSMauro Carvalho Chehabto a BFQ queue once it is set in service (of course within the limits
478*898bd37aSMauro Carvalho Chehabof the above timeout). According to what said in the description of
479*898bd37aSMauro Carvalho Chehabthe algorithm, larger values increase the throughput in proportion to
480*898bd37aSMauro Carvalho Chehabthe percentage of sequential I/O requests issued. The price of larger
481*898bd37aSMauro Carvalho Chehabvalues is that they coarsen the granularity of short-term bandwidth
482*898bd37aSMauro Carvalho Chehaband latency guarantees.
483*898bd37aSMauro Carvalho Chehab
484*898bd37aSMauro Carvalho ChehabThe default value is 0, which enables auto-tuning: BFQ sets max_budget
485*898bd37aSMauro Carvalho Chehabto the maximum number of sectors that can be served during
486*898bd37aSMauro Carvalho Chehabtimeout_sync, according to the estimated peak rate.
487*898bd37aSMauro Carvalho Chehab
488*898bd37aSMauro Carvalho ChehabFor specific devices, some users have occasionally reported to have
489*898bd37aSMauro Carvalho Chehabreached a higher throughput by setting max_budget explicitly, i.e., by
490*898bd37aSMauro Carvalho Chehabsetting max_budget to a higher value than 0. In particular, they have
491*898bd37aSMauro Carvalho Chehabset max_budget to higher values than those to which BFQ would have set
492*898bd37aSMauro Carvalho Chehabit with auto-tuning. An alternative way to achieve this goal is to
493*898bd37aSMauro Carvalho Chehabjust increase the value of timeout_sync, leaving max_budget equal to 0.
494*898bd37aSMauro Carvalho Chehab
495*898bd37aSMauro Carvalho Chehabweights
496*898bd37aSMauro Carvalho Chehab-------
497*898bd37aSMauro Carvalho Chehab
498*898bd37aSMauro Carvalho ChehabRead-only parameter, used to show the weights of the currently active
499*898bd37aSMauro Carvalho ChehabBFQ queues.
500*898bd37aSMauro Carvalho Chehab
501*898bd37aSMauro Carvalho Chehab
502*898bd37aSMauro Carvalho Chehab4. Group scheduling with BFQ
503*898bd37aSMauro Carvalho Chehab============================
504*898bd37aSMauro Carvalho Chehab
505*898bd37aSMauro Carvalho ChehabBFQ supports both cgroups-v1 and cgroups-v2 io controllers, namely
506*898bd37aSMauro Carvalho Chehabblkio and io. In particular, BFQ supports weight-based proportional
507*898bd37aSMauro Carvalho Chehabshare. To activate cgroups support, set BFQ_GROUP_IOSCHED.
508*898bd37aSMauro Carvalho Chehab
509*898bd37aSMauro Carvalho Chehab4-1 Service guarantees provided
510*898bd37aSMauro Carvalho Chehab-------------------------------
511*898bd37aSMauro Carvalho Chehab
512*898bd37aSMauro Carvalho ChehabWith BFQ, proportional share means true proportional share of the
513*898bd37aSMauro Carvalho Chehabdevice bandwidth, according to group weights. For example, a group
514*898bd37aSMauro Carvalho Chehabwith weight 200 gets twice the bandwidth, and not just twice the time,
515*898bd37aSMauro Carvalho Chehabof a group with weight 100.
516*898bd37aSMauro Carvalho Chehab
517*898bd37aSMauro Carvalho ChehabBFQ supports hierarchies (group trees) of any depth. Bandwidth is
518*898bd37aSMauro Carvalho Chehabdistributed among groups and processes in the expected way: for each
519*898bd37aSMauro Carvalho Chehabgroup, the children of the group share the whole bandwidth of the
520*898bd37aSMauro Carvalho Chehabgroup in proportion to their weights. In particular, this implies
521*898bd37aSMauro Carvalho Chehabthat, for each leaf group, every process of the group receives the
522*898bd37aSMauro Carvalho Chehabsame share of the whole group bandwidth, unless the ioprio of the
523*898bd37aSMauro Carvalho Chehabprocess is modified.
524*898bd37aSMauro Carvalho Chehab
525*898bd37aSMauro Carvalho ChehabThe resource-sharing guarantee for a group may partially or totally
526*898bd37aSMauro Carvalho Chehabswitch from bandwidth to time, if providing bandwidth guarantees to
527*898bd37aSMauro Carvalho Chehabthe group lowers the throughput too much. This switch occurs on a
528*898bd37aSMauro Carvalho Chehabper-process basis: if a process of a leaf group causes throughput loss
529*898bd37aSMauro Carvalho Chehabif served in such a way to receive its share of the bandwidth, then
530*898bd37aSMauro Carvalho ChehabBFQ switches back to just time-based proportional share for that
531*898bd37aSMauro Carvalho Chehabprocess.
532*898bd37aSMauro Carvalho Chehab
533*898bd37aSMauro Carvalho Chehab4-2 Interface
534*898bd37aSMauro Carvalho Chehab-------------
535*898bd37aSMauro Carvalho Chehab
536*898bd37aSMauro Carvalho ChehabTo get proportional sharing of bandwidth with BFQ for a given device,
537*898bd37aSMauro Carvalho ChehabBFQ must of course be the active scheduler for that device.
538*898bd37aSMauro Carvalho Chehab
539*898bd37aSMauro Carvalho ChehabWithin each group directory, the names of the files associated with
540*898bd37aSMauro Carvalho ChehabBFQ-specific cgroup parameters and stats begin with the "bfq."
541*898bd37aSMauro Carvalho Chehabprefix. So, with cgroups-v1 or cgroups-v2, the full prefix for
542*898bd37aSMauro Carvalho ChehabBFQ-specific files is "blkio.bfq." or "io.bfq." For example, the group
543*898bd37aSMauro Carvalho Chehabparameter to set the weight of a group with BFQ is blkio.bfq.weight
544*898bd37aSMauro Carvalho Chehabor io.bfq.weight.
545*898bd37aSMauro Carvalho Chehab
546*898bd37aSMauro Carvalho ChehabAs for cgroups-v1 (blkio controller), the exact set of stat files
547*898bd37aSMauro Carvalho Chehabcreated, and kept up-to-date by bfq, depends on whether
548*898bd37aSMauro Carvalho ChehabCONFIG_BFQ_CGROUP_DEBUG is set. If it is set, then bfq creates all
549*898bd37aSMauro Carvalho Chehabthe stat files documented in
550*898bd37aSMauro Carvalho ChehabDocumentation/cgroup-v1/blkio-controller.rst. If, instead,
551*898bd37aSMauro Carvalho ChehabCONFIG_BFQ_CGROUP_DEBUG is not set, then bfq creates only the files::
552*898bd37aSMauro Carvalho Chehab
553*898bd37aSMauro Carvalho Chehab  blkio.bfq.io_service_bytes
554*898bd37aSMauro Carvalho Chehab  blkio.bfq.io_service_bytes_recursive
555*898bd37aSMauro Carvalho Chehab  blkio.bfq.io_serviced
556*898bd37aSMauro Carvalho Chehab  blkio.bfq.io_serviced_recursive
557*898bd37aSMauro Carvalho Chehab
558*898bd37aSMauro Carvalho ChehabThe value of CONFIG_BFQ_CGROUP_DEBUG greatly influences the maximum
559*898bd37aSMauro Carvalho Chehabthroughput sustainable with bfq, because updating the blkio.bfq.*
560*898bd37aSMauro Carvalho Chehabstats is rather costly, especially for some of the stats enabled by
561*898bd37aSMauro Carvalho ChehabCONFIG_BFQ_CGROUP_DEBUG.
562*898bd37aSMauro Carvalho Chehab
563*898bd37aSMauro Carvalho ChehabParameters to set
564*898bd37aSMauro Carvalho Chehab-----------------
565*898bd37aSMauro Carvalho Chehab
566*898bd37aSMauro Carvalho ChehabFor each group, there is only the following parameter to set.
567*898bd37aSMauro Carvalho Chehab
568*898bd37aSMauro Carvalho Chehabweight (namely blkio.bfq.weight or io.bfq-weight): the weight of the
569*898bd37aSMauro Carvalho Chehabgroup inside its parent. Available values: 1..10000 (default 100). The
570*898bd37aSMauro Carvalho Chehablinear mapping between ioprio and weights, described at the beginning
571*898bd37aSMauro Carvalho Chehabof the tunable section, is still valid, but all weights higher than
572*898bd37aSMauro Carvalho ChehabIOPRIO_BE_NR*10 are mapped to ioprio 0.
573*898bd37aSMauro Carvalho Chehab
574*898bd37aSMauro Carvalho ChehabRecall that, if low-latency is set, then BFQ automatically raises the
575*898bd37aSMauro Carvalho Chehabweight of the queues associated with interactive and soft real-time
576*898bd37aSMauro Carvalho Chehabapplications. Unset this tunable if you need/want to control weights.
577*898bd37aSMauro Carvalho Chehab
578*898bd37aSMauro Carvalho Chehab
579*898bd37aSMauro Carvalho Chehab[1]
580*898bd37aSMauro Carvalho Chehab    P. Valente, A. Avanzini, "Evolution of the BFQ Storage I/O
581*898bd37aSMauro Carvalho Chehab    Scheduler", Proceedings of the First Workshop on Mobile System
582*898bd37aSMauro Carvalho Chehab    Technologies (MST-2015), May 2015.
583*898bd37aSMauro Carvalho Chehab
584*898bd37aSMauro Carvalho Chehab    http://algogroup.unimore.it/people/paolo/disk_sched/mst-2015.pdf
585*898bd37aSMauro Carvalho Chehab
586*898bd37aSMauro Carvalho Chehab[2]
587*898bd37aSMauro Carvalho Chehab    P. Valente and M. Andreolini, "Improving Application
588*898bd37aSMauro Carvalho Chehab    Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of
589*898bd37aSMauro Carvalho Chehab    the 5th Annual International Systems and Storage Conference
590*898bd37aSMauro Carvalho Chehab    (SYSTOR '12), June 2012.
591*898bd37aSMauro Carvalho Chehab
592*898bd37aSMauro Carvalho Chehab    Slightly extended version:
593*898bd37aSMauro Carvalho Chehab
594*898bd37aSMauro Carvalho Chehab    http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite-results.pdf
595*898bd37aSMauro Carvalho Chehab
596*898bd37aSMauro Carvalho Chehab[3]
597*898bd37aSMauro Carvalho Chehab   https://github.com/Algodev-github/S
598