Adam Megacz
2007-May-06 18:31 UTC
[zfs-discuss] does every fsync() require O(log n) platter-writes?
After reading through the ZFS slides, it appears to be the case that if ZFS wants to modify a single data block, if must rewrite every block between that modified block and the uberblock (root of the tree). Is this really the case? If so, does this mean that every commit operation (ie every fsync()) in ZFS requires O(log n) platter writes? Thanks, - a -- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380
Neil.Perrin at Sun.COM
2007-May-07 03:22 UTC
[zfs-discuss] does every fsync() require O(log n) platter-writes?
Adam Megacz wrote:> After reading through the ZFS slides, it appears to be the case that > if ZFS wants to modify a single data block, if must rewrite every > block between that modified block and the uberblock (root of the tree).> Is this really the case? That is true when commiting the transaction grouptp the main pool every 5 seconds. However, this isn''t so bad as a lot of transactions are commited which likely have common roots and writes are aggregated and striped across the pool etc...> If so, does this mean that every commit > operation (ie every fsync()) in ZFS requires O(log n) platter writes?The ZIL does not modify the main pool. It only writes system call transactions related to the file being fsynced and any other transactions that might related to that file (eg mkdir, rename). Writes for these transactions are also aggregated and written use a block size tailored to fit the data. Typically for a single system call just one write occurs. On a system crash or power fail those ZIL transactions are replayed. See also: http://blogs.sun.com/perrin Neil.> > Thanks, > > - a >
Adam Megacz
2007-May-07 03:56 UTC
[zfs-discuss] Re: does every fsync() require O(log n) platter-writes?
Ah, okay. The slides I read said that in ZFS there is "no journal -- not needed" (slide #9): http://www.opensolaris.org/os/community/zfs/docs/zfs_last.pdf I guess the slides are out of date in light of the "ZFS Intent Log" journal? Anyways, it all makes sense now. Without a journal, you''d need to perform the operation on slide #11 for every fsync(), which would be a major performance problem. With a journal, you don''t need to do this. Great work, guys... - a -- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380
Neil.Perrin at Sun.COM
2007-May-07 05:17 UTC
[zfs-discuss] Re: does every fsync() require O(log n) platter-writes?
Adam Megacz wrote:> Ah, okay. The slides I read said that in ZFS there is "no journal -- > not needed" (slide #9): > > http://www.opensolaris.org/os/community/zfs/docs/zfs_last.pdf > > I guess the slides are out of date in light of the "ZFS Intent Log" > journal?Yes , I can understand your confusion. Technically the intent log is not a journal. A journal has to be replayed to get meta data consistency of the fs. UFS logging, EXT3 and VXFS all use journals. For perf reasons user data is typically not logged leading to user data inconsistency. On the other hand, the zfs pool is always consistent whether or not the intent log is replayed.> > Anyways, it all makes sense now. Without a journal, you''d need to > perform the operation on slide #11 for every fsync(), which would be a > major performance problem. With a journal, you don''t need to do this. > > Great work, guys...- Thanks Adam.> > - a >