Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 14:52:40 -0000
From:      "Matt Churchyard" <matt.churchyard@userve.net>
To:        <freebsd-fs@freebsd.org>
Subject:   ZFS: cache_flush_disable
Message-ID:  <36B5948F85049844985F24A1CE55B2CBEB980A@USDSERVER.usd.local>

next in thread | raw e-mail | index | archive | help
Can anyone give some knowledgeable info on the
vfs.zfs.cache_flush_disable variable?=20
There's a lot of talk going on in the FreeBSD forums about how to get
the best performance but no-one really knows exactly what these settings
do (searching the net doesn't really find anyone who knows either).
There's a lot of mis-information going around as well and so I'd like to
start trying to get some concrete information if possible.

I'd like to know

1) What this setting actually does
2) If it's safe assuming you have battery backed ZIL (e.g. supercap SSD)

I am under the impression it controls whether ZFS asks disks to flush
their caches or not.
However, there's an entire function in zil.c (zil_add_block) that is
skipped when this flag is set. I'm not sure what this function does but
it seems to do more than just flush caches?

Regarding question 2, if this variable affects flushing of pool disks,
not just the ZIL, I can imagine a scenario where ZFS flushes a
transaction to the pool, but a power loss occurs while some of that data
is still sat in the disk cache. Usually ZFS would flush the cache and
only assume the write was complete at that point.
Assuming it affects all disks, is it possible to turn off write cache
per disk? I have seen hw.ata.wc but I'm not sure this still applies and
if it does it'll affect the ZIL which you'd want to leave enabled if it
was protected.

--
Matt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36B5948F85049844985F24A1CE55B2CBEB980A>