2005-04-16 15:20:36 -07:00
|
|
|
Deadline IO scheduler tunables
|
|
|
|
==============================
|
|
|
|
|
|
|
|
This little file attempts to document how the deadline io scheduler works.
|
|
|
|
In particular, it will clarify the meaning of the exposed tunables that may be
|
|
|
|
of interest to power users.
|
|
|
|
|
2007-10-15 04:22:26 -07:00
|
|
|
Selecting IO schedulers
|
|
|
|
-----------------------
|
|
|
|
Refer to Documentation/block/switching-sched.txt for information on
|
|
|
|
selecting an io scheduler on a per-device basis.
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
********************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
read_expire (in ms)
|
|
|
|
-----------
|
|
|
|
|
2006-10-03 13:49:15 -07:00
|
|
|
The goal of the deadline io scheduler is to attempt to guarantee a start
|
2005-04-16 15:20:36 -07:00
|
|
|
service time for a request. As we focus mainly on read latencies, this is
|
|
|
|
tunable. When a read request first enters the io scheduler, it is assigned
|
|
|
|
a deadline that is the current time + the read_expire value in units of
|
2006-10-03 13:50:39 -07:00
|
|
|
milliseconds.
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
write_expire (in ms)
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Similar to read_expire mentioned above, but for writes.
|
|
|
|
|
|
|
|
|
|
|
|
fifo_batch
|
|
|
|
----------
|
|
|
|
|
|
|
|
When a read request expires its deadline, we must move some requests from
|
|
|
|
the sorted io scheduler list to the block device dispatch queue. fifo_batch
|
2007-10-15 04:22:26 -07:00
|
|
|
controls how many requests we move.
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
2007-10-15 04:22:26 -07:00
|
|
|
writes_starved (number of dispatches)
|
|
|
|
--------------
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
When we have to move requests from the io scheduler queue to the block
|
|
|
|
device dispatch queue, we always give a preference to reads. However, we
|
|
|
|
don't want to starve writes indefinitely either. So writes_starved controls
|
|
|
|
how many times we give preference to reads over writes. When that has been
|
|
|
|
done writes_starved number of times, we dispatch some writes based on the
|
|
|
|
same criteria as reads.
|
|
|
|
|
|
|
|
|
|
|
|
front_merges (bool)
|
|
|
|
------------
|
|
|
|
|
|
|
|
Sometimes it happens that a request enters the io scheduler that is contigious
|
|
|
|
with a request that is already on the queue. Either it fits in the back of that
|
|
|
|
request, or it fits at the front. That is called either a back merge candidate
|
|
|
|
or a front merge candidate. Due to the way files are typically laid out,
|
|
|
|
back merges are much more common than front merges. For some work loads, you
|
|
|
|
may even know that it is a waste of time to spend any time attempting to
|
|
|
|
front merge requests. Setting front_merges to 0 disables this functionality.
|
|
|
|
Front merges may still occur due to the cached last_merge hint, but since
|
|
|
|
that comes at basically 0 cost we leave that on. We simply disable the
|
|
|
|
rbtree front sector lookup when the io scheduler merge function is called.
|
|
|
|
|
|
|
|
|
2007-10-15 02:42:52 -07:00
|
|
|
Nov 11 2002, Jens Axboe <jens.axboe@oracle.com>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|