DragonFly On-Line Manual Pages
DSCHED_BFQ(4) DragonFly Kernel Interfaces Manual DSCHED_BFQ(4)
NAME
dsched_bfq -- Budget Fair Queueing disk scheduling policy
SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
options DSCHED_BFQ
Alternatively, to load the driver as a module at boot time, place the
following line in loader.conf(5):
dsched_bfq_load="YES"
DESCRIPTION
The dsched_bfq disk scheduler is invented by Paolo Valente. The current
version of dsched_bfq in DragonFly is implemented according to his tech-
nique report. Also, some additional features are added into the current
version; they are inspired by the Linux version, but are totally written
from scratch.
Like the CFQ (Complete Fair Queue) disk scheduler under Linux, dsched_bfq
is a fair queueing scheduler that aims to improve the interactivity and
lower the latency of the system. Maximizing throughput, however, is not
the major design goal of it. So it is better to switch to dsched_bfq if
the computer is for desktop usage, in which interactivity eclipses
throughput in general.
Switching To BFQ
You may use sysctl(8) to switch to dsched_bfq (where ``ad0'' is the name
of your hard drive):
sysctl dsched.policy.ad0=bfq
A loader tunable of the same name is available for setting it perma-
nently.
Tuning BFQ
Currently dsched_bfq has two tunable parameters: the global AS switch and
the maximum budget. They can be tuned by the sysctl(8) command, for
example:
#enable the global AS feature:
sysctl dsched.bfq.ad0.as_switch=1
#set the max budget to 512KB:
sysctl dsched.bfq.ad0.max_budget=524288
#enable automatic max budget adapting:
sysctl dsched.bfq.ad0.auto_max_budget=0
The AS feature
It is reported that turning AS on may affect the interactivity
and increase max latency greatly. It is probably due to the
over-serialized implementation of BFQ. However, the blogbench
shows that turning AS on will also increase the throughput
greatly.
Suggestion: turn on the AS feature, for it effects little on
average latency.
The max budget
One thread could be assigned a budget no more than the max bud-
get. Generally, a higher budget means higher throughput because
of less operations on WF2Q+ augtree, while a lower budget force
the scheduler cost more on those operations.
However, the real world experiments show that a too high budget
affects interactivity heavily. A too low budget will also cause
higher latency, and if the budget is less than 64KB (65536),
which is smaller than the size of some bios, the scheduler will
retrograde to a round-robin scheduler, which is not a good form
for a disk scheduler.
Suggestions: Do not use automatic max budget, it is usually too
high. A budget of 1/10 of the automatic max budget may be
proper. In general, 512K(default), 256K, 192K can be good. It
is better to determine the best max budget by binary selecting by
the result of some benchmarks.
SEE ALSO
dsched(4), kldload(8), sysctl(8)
http://leaf.dragonflybsd.org/~brillsp/bfq_doc/bfq.html
HISTORY
The dsched_bfq scheduler first appeared in DragonFly 2.11.
AUTHORS
The dsched_bfq scheduling policy was written by Brills Peng.
BUGS
When switching to another dsched policy from BFQ, the system may dead-
lock.
Currently, the overall performance is not very good and it is not tested
on large number of machines. It is not recommended to use this version
in a productivity environment.
DragonFly 4.3 August 19, 2011 DragonFly 4.3