From owner-freebsd-stable@FreeBSD.ORG Sat Jun 20 21:29:27 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 77D711065674; Sat, 20 Jun 2009 21:29:27 +0000 (UTC) (envelope-from dan.naumov@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by mx1.freebsd.org (Postfix) with ESMTP id 23A308FC14; Sat, 20 Jun 2009 21:29:26 +0000 (UTC) (envelope-from dan.naumov@gmail.com) Received: by an-out-0708.google.com with SMTP id c3so1079624ana.13 for ; Sat, 20 Jun 2009 14:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=rO53cPkpJfOHMISRRIGlmuGfc85i9Jl/c3EYhiF/fic=; b=CEd9X6OQLPTWGmVh8p7KaPSc9PSWeVZfwfDadEvn9PRTmse+LlfiYxp4wUg/+NlQ9y 5Dd+/N+vhskfU9lHZj6N9IxAcu1bV4CQwJx8+Sjq4iZeaXwSiDWMKRsXMjuaJRMfPgCe 9HmapbsS50KRCQmVDBOmhhMHGVMzBw/wX9HkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=wkSOKGntqnBsOzuEbb0541Gnolterw16gake97k0EfJemzpAkK8y/9N05RnS/422C/ s0ajPNsXEDc0SB0iyhrhk67npcd3rQjB43hjUVj4ndUbw+Td/gAbrRGJZvpPZ6TAtHvz rwLv8DWoFWNICUKtU/Bwg5fwyEQ0J9CMbyB/g= MIME-Version: 1.0 Received: by 10.100.133.2 with SMTP id g2mr5833015and.23.1245533366453; Sat, 20 Jun 2009 14:29:26 -0700 (PDT) Date: Sun, 21 Jun 2009 00:29:26 +0300 Message-ID: From: Dan Naumov To: FreeBSD-STABLE Mailing List , freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: 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 21:29:28 -0000 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. 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? Another thing I have been pondering is: I do have 2gb of space left unused on the system (currently being used as swap, I have 2 swap slices, one 1gb at the very beginning of the disk, the other being 2gb at the end), which I could turn into a GJOURNAL for the root filesystem... Sincerely, - Dan Naumov