immense delayed write to file system (ZFS and UFS2), performance
dillon at apollo.backplane.com
Tue Jan 26 18:10:51 UTC 2010
:I'm experiencing the same thing, except in my case it's most noticeable
:when writing to a USB flash drive with a FAT32 filesystem. It slows the
:entire system down, even if the data being written is coming from cache
:or a memory file system.
:I don't know if it's related. I'm running 8-STABLE from about 4 December.
I don't know re: the main thread but in regards to writing to a USB
flash drive interfering with other operations the most likely cause
is that the buffer cache fills up with dirty buffers destined for the
(slow) USB drive. This causes other unrelated drive subsystems
to block on the buffer cache.
There are no easy answers. A poor-man's solution would be to limit
dirty buffers in the buffer cache to 80% of the nominal dirty maximum
on a per-mount basis so no single mount can kill the buffer cache.
(One can't just cut-up the buffer cache as that would leave too few
buffers available for each mount to operate efficiently). A per-mount
minimum buffer guarantee would also help smooth things out but the
value would have to be small (comprise no more than 20% of the buffer
cache in aggregate).
In the case of UFS the write-behind code is asynchronous, so even
though UFS wants to flush the buffers out all that happens in reality
when writing to slow media is that the dirty buffers wind up on
the I/O queue (which is actually worse then leaving them B_DELWRI in
the buffer cache because now the VM pages are all soft-busied).
<dillon at backplane.com>
More information about the freebsd-stable