|
Description
|
The ZFS intent log preallocates a new log block before
writing out one in order to maintain a chain. The ZIL
supports a variable block size, and makes a choice as
to the best size based on what is currently waiting
to be flushed, or if 0 then on the previous block size.
The last case handles the situation where a single thread
is doing O_DSYNC writes, so there is nothing waiting
but we don't want to allocate a minimum 4K block.
The problem occurs if the previous log block written
was say 128KB then we keep getting 128KB even
is we only need a 4K, leading to writing 124KB
too much. This large block is sticky in that it
will reamin this size until another thread also uses
the ZIL and a log flush is waiting.
The solution is to use the smaller buffer that would contain
the last block, instead of the last block size.
This information is in lwb_nused. See suggested fix.
|