cfq-iosched: adapt slice to number of processes doing I/O
authorCorrado Zoccolo <czoccolo@gmail.com>
Mon, 26 Oct 2009 21:44:04 +0000 (22:44 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 28 Oct 2009 08:23:26 +0000 (09:23 +0100)
commit5db5d64277bf390056b1a87d0bb288c8b8553f96
treeeced8cdeae49e6920bbb9ae18b33ed7001332233
parent1a1238a7dd48e48b3bba8f426a1d61c22c80d6d1
cfq-iosched: adapt slice to number of processes doing I/O

When the number of processes performing I/O concurrently increases,
a fixed time slice per process will cause large latencies.

This patch, if low_latency mode is enabled,  will scale the time slice
assigned to each process according to a 300ms target latency.

In order to keep fairness among processes:
* The number of active processes is computed using a special form of
running average, that quickly follows sudden increases (to keep latency low),
and decrease slowly (to have fairness in spite of rapid decreases of this
value).

To safeguard sequential bandwidth, we impose a minimum time slice
(computed using 2*cfq_slice_idle as base, adjusted according to priority
and async-ness).

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/cfq-iosched.c