From owner-freebsd-stable@FreeBSD.ORG Sat Jun 20 23:11:45 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 529EA1065686 for ; Sat, 20 Jun 2009 23:11:45 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id D65148FC1F for ; Sat, 20 Jun 2009 23:11:44 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:57214 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1MI9if-0001bt-4s for freebsd-stable@freebsd.org; Sun, 21 Jun 2009 01:11:35 +0200 Received: (qmail 62710 invoked from network); 21 Jun 2009 01:11:30 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 21 Jun 2009 01:11:30 +0200 Received: (qmail 89011 invoked by uid 1001); 21 Jun 2009 01:11:30 +0200 Date: Sun, 21 Jun 2009 01:11:30 +0200 From: Erik Trulsson To: Dan Naumov Message-ID: <20090620231130.GA88907@owl.midgard.homeip.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1MI9if-0001bt-4s. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MI9if-0001bt-4s a036bd85a5b5650d08cbfcdbbda101bf Cc: freebsd-fs@freebsd.org, FreeBSD-STABLE Mailing List Subject: Re: ufs2 / softupdates / ZFS / disk write cache X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2009 23:11:46 -0000 On Sun, Jun 21, 2009 at 12:29:26AM +0300, Dan Naumov wrote: > I have the following setup: > > A single consumer-grade 2tb SATA disk: Western Digital Green (model > WDC WD20EADS-00R6B0). This disk is setup like this: > > 16gb root partition with UFS2 + softupdates, containing mostly static things: > /bin /boot /etc /root /sbin /usr /var and such > > a 1,9tb non-redundant zfs pool on top of a slice, it hosts things like: > /DATA, /home, /usr/local, /var/log and such. > > What should I do to ensure (as much as possible) filesystem > consistency of the root filesystem in the case of the power loss? I > know there have been a lot of discussions on the subject of > consumer-level disks literally lying about the state of files in > transit (disks telling the system that files have been written to disk > while in reality they are still in disk's write cache), in turn > throwing softupdates off balance (since softupdates assumes the disks > don't lie about such things), in turn sometimes resulting in severe > data losses in the case of a system power loss during heavy disk IO. Note that this is not something specific to softupdates, but applies when you are not using softupdates as well. > > One of the solutions that was often brought up in the mailing lists is > disabling the actual disk write cache via adding hw.ata.wc=0 to > /boot/loader.conf, FreeBSD 4.3 actually even had this setting by > default, but this was apparently reverted back because some people > have reported a write performance regression on the tune of becoming > 4-6 times slower. So what should I do in my case? Should I disable > disk write cache via the hw.ata.wc tunable? As far as I know, ZFS has > a write cache of it's own and since the ufs2 root filesystem in my > case is mostly static data, I am guessing I "shouldn't" notice that > big of a performance hit. Or am I completely in the wrong here and > setting hw.ata.wc=0 is going to adversely affect the write performance > on both the root partition AND the zfs pool despite zfs using it's own > write cache? Why don't you try it and see if you notice the performance hit? You will almost certainly see some reduced write performance if you disable the disk's cache, but how noticable this will be for your setup and your disk usage is something only you can answer. My guess is that it will be quite noticable, but that is only a guess. (Keep in mind that UFS+softupdates does quite a bit of write-caching on its own, so just switching to ZFS is unlikely to improve write performance significantly compared to using UFS.) -- Erik Trulsson ertr1013@student.uu.se