Change bwillwrite() to smooth out performance under heavy loads. Blocking
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 10 Jun 2008 05:02:09 +0000 (05:02 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 10 Jun 2008 05:02:09 +0000 (05:02 +0000)
commiteee827ad6ffb1eb6ea4684478cfcfbb6f1884cbe
tree17aba998e145fba94db3b0c15a102f74c57d585b
parentcebe949331f2cd2feb05aaab0a1282926277b696
Change bwillwrite() to smooth out performance under heavy loads.  Blocking
based on strict hystersis was being used to try to gang flushes together
but filesystems can still blow out the buffer cache and cause processes
to block for long periods of time waiting for the dirty count to drop
significantly.

Instead, as the number of dirty buffers exceeds the desired maximum
bwillwrite() imposes a dynamic delay which increases as the number of
dirty buffers increase.  This improves the stall behavior under heavy loads
and keeps the system responsive.

TODO: The algorithm needs to have a per-LWP heuristic to penalize heavy
writers more then light ones.
sys/kern/vfs_bio.c