dsched - Add the FQ policy
* Add the FQ (fair queueing) policy for the dsched I/O scheduler
framework.
* Right now, this is at best experimental; it only starts rate limiting
when the disk is busy. Each process is allocated an equal fair amount
of disk time, based on the average request latency and tps.
If the disk is busy and one process exceeeds its fair share, its bios
are queued for later dispatch.
To avoid starvation of heavy write processes, heavy writes are
interleaved once every 3 scheduler rebalances. The scheduler rebalance
time is currently set to 1s, so that exceeding processes will be
limited after this period.
* While I've done some limited testing on switching policies at runtime
and even under heavy I/O going on, it is not recommended to do this,
as some problems will crop up.
* Future work to do:
- stabilization pass
- adding bucket support (i.e. having different priority buckets
for groups of processes, so that for example processes A,B and
C get a total aggregate of 80% disk time, while processes D
and E get a total aggregate of 20%, instead of each process
getting 20%)
- adding an "ionice" userland tool to allow to change the
bucket/priority of a process