Monday Nov 28, 2005
Monday Nov 28, 2005
As I mentioned in my previous
blog entry, the ZIL (ZFS Intent Log) operates with block sizes
between ZIL_MIN_BLKSZ(4K)
and ZIL_MAX_BLKSZ(128k).
Let us take a closer look at this.
The ZIL has to allocate a new zil block before it commits the current zil
block. This is because the zil block being committed has to have
a link to the next zil block. If you do not preallocate, you will have
to update the next pointer in
the previous block whenever you write a new zil block. This means that
you will have read in the previous block, update the next pointer, and rewrite it out.
Obviously this is quite expensive (and quite complicated).
The current block selection strategy is to chose either
the sum of all outstanding ZIL blocks or if no outstanding zil blocks
are present, the size of the last zil block that was committed. If the
size of the outstanding zil blocks is greater than 128k, it is rounded
up to 128k.
The above strategy works in most cases, but behaves badly for certain edge cases.
Let us examine the zil block size for the set of
actions described below
(dtrace -n
::zil_lwb_commit:entry'{@[1]=quantize((lwb_t*)args[2]->lwb_sz);}')