v writes:
 > Hi,
 > A basic question regarding how zil works:
 > For asynchronous write, will zil be used?
 > For synchronous write, and if io is small, will the whole io be place on 
 > zil? or just the pointer be save into zil? what about large size io?
 > 

Let me try.

ZIL : code and data structure to track system calls into a zvol or zfs 
filesystem
LOG : stable storage log  managed by the zil keeping track of synchronous 
operation.
SLOG: log device seperate from the regular pool of disk; typically an SSD or 
NVRAM based.

For asynchronous writes, the ZIL keeps track of those
operations; but does not write stable LOG records unless an
fsync is issued. Of course we recently added zfs property
"sync". If set to sync=always; then there are no more
asynchronous writes.

For synchronous writes, the ZIL keeps track of those
operations and generates a stable LOG record. There are 2
options open to the ZIL here. Either issue an I/O for a full
record and another I/O that points to it, or issue a single
I/O containing ZIL metadata and file data. When issuing a 1
Byte synchronous write; it's intuitively best to have a
single I/O with the 1Byte of new data (partial zfs record)
and all the ZIL metadata to handle it. Later during a Pool
TXG, the whole record will be updated in the main disk
pool. For a large synchronous write, it's best to have the
modified whole records be sent into the main disk pool and
have the zil record only track pointers to the modified
records. In between you need to make a decision between the
2 options. That decision depends on, the write size, the
recordsize, the presence of log devices, the logbias
setting, the current load on a given filesystem etc.

The goal here is both to handle the current operation as
fast as possible but also keep SLOG device available for
fast handling of synchronous writes by other threads. So
it's a fairly complex set of requirements but it seems to be
evolving in the right direction.

-r




 > Regards
 > Victor
 > -- 
 > This message posted from opensolaris.org
 > _______________________________________________
 > zfs-discuss mailing list
 > zfs-discuss@opensolaris.org
 > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to