ZFS v28 and zil_disable

Jeremy Chadwick freebsd at jdc.parodius.com
Sat Jan 1 00:32:48 UTC 2011

On Fri, Dec 31, 2010 at 08:01:17PM -0400, Chris Forgeron wrote:
> Oh, and then I read what I post, and notice that the zil_disable parts are in the .orig files, from the patch. :-)
> Oh well, I guess I'll just have to invest in a proper ZIL device. 
> -----Original Message-----
> From: owner-freebsd-stable at freebsd.org [mailto:owner-freebsd-stable at freebsd.org] On Behalf Of Chris Forgeron
> Sent: December-31-10 6:01 PM
> To: freebsd-stable at freebsd.org
> Subject: ZFS v28 and zil_disable
> BTW, I'm noticing the removal of vfs.zfs.zil_disable as well - It's not listed as a sysctl when I check vfs.zfs, but I see it's still in the source code;
> In usr/src/sys/cddl/ :
> # grep -r zil_disable *
> cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h.orig:extern int zil_disable;
> cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c.orig:int zil_disable = 0;      /* disable intent logging */
> cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c.orig:TUNABLE_INT("vfs.zfs.zil_disable", &zil_disable); cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c.orig:SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_disable, CTLFLAG_RW, &zil_disable, 0,
> cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c.orig:   if (zil_disable) {
> cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c.orig:         if (bp->bio_cmd == BIO_FLUSH && !zil_disable)
> I know Sun was trying to move away from allowing people to disable the ZIL, but was this by design in the FreeBSD port, or are we just missing some code to link the sysctl up with the code to easily disable the ZIL? 
> I'll try setting zil_disable=1 in the source tomorrow and recompile to see if it works.  It's such a huge speed increase for some operations (80MB/sec with ZIL, 450 MB/sec without ZIL) that I still use zil_disable.
> I'll also have to check my 9.0-CUR v28 patch, although I assume it's the same. 
> -----Original Message-----
> From: owner-freebsd-stable at freebsd.org [mailto:owner-freebsd-stable at freebsd.org] On Behalf Of Jean-Yves Avenard
> Sent: December-27-10 1:31 AM
> To: jhell
> Cc: freebsd-stable at freebsd.org
> Subject: Re: New ZFSv28 patchset for 8-STABLE: Kernel Panic
> Jean-Yves
> PS: saving my 5MB files over the network , went from 40-55s with v15 to a constant 16s with v28... I can't test with ZIL completely disabled , it seems that vfs.zfs.zil_disable has been removed, and so did vfs.zfs.write_limit_override

You shouldn't disable the ZIL[1], and you don't need a "proper ZIL
device" for the ZIL to work.  FreeBSD ZFS, like its Solaris counterpart,
offers the ability for the ZIL to be associated with one or more
dedicated devices[1].  These are referred to as "log" devices (not to be
confused with "cache" devices).

In the case you use a dedicated device for your ZIL, be aware that you
should probably use two[2] devices (or if a single physical device, two
slices) else risk data integrity problems.

Switching over to a brief mention of "cache" devices, there is one
case[3] of someone experiencing high CPU when either a USB flash drive
or an SSD drive[4], where rebooting the system apparently solved the
problem (we do not know if this was the case permanently or

[1]: http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide#Disabling_the_ZIL_.28Don.27t.29
[2]: http://forums.freebsd.org/showthread.php?t=18221
[3]: http://lists.freebsd.org/pipermail/freebsd-stable/2010-November/060014.html
[4]: http://lists.freebsd.org/pipermail/freebsd-stable/2010-November/060076.html

| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |

More information about the freebsd-stable mailing list