From owner-freebsd-questions@FreeBSD.ORG Wed Jul 6 13:18:28 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E54F16A41C for ; Wed, 6 Jul 2005 13:18:28 +0000 (GMT) (envelope-from mkb@mkbuelow.net) Received: from luzifer.incubus.de (incubus.de [80.237.207.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DCA543D45 for ; Wed, 6 Jul 2005 13:18:27 +0000 (GMT) (envelope-from mkb@mkbuelow.net) Received: from drjekyll.mkbuelow.net (p54AAA629.dip0.t-ipconnect.de [84.170.166.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by luzifer.incubus.de (Postfix) with ESMTP id F379832194 for ; Wed, 6 Jul 2005 15:21:18 +0200 (CEST) Received: from drjekyll.mkbuelow.net (mkb@localhost.mkbuelow.net [127.0.0.1]) by drjekyll.mkbuelow.net (8.13.3/8.13.3) with ESMTP id j66DIrHx000895 for ; Wed, 6 Jul 2005 15:18:54 +0200 (CEST) (envelope-from mkb@drjekyll.mkbuelow.net) Message-Id: <200507061318.j66DIrHx000895@drjekyll.mkbuelow.net> From: Matthias Buelow To: freebsd-questions@freebsd.org X-Mailer: MH-E 7.84; nmh 1.0.4; XEmacs 21.4 (patch 17) Date: Wed, 06 Jul 2005 15:18:53 +0200 Sender: mkb@mkbuelow.net Subject: disk write barriers X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2005 13:18:28 -0000 Hi folks, I'd like to know something about the (possible) existence of disk write-barriers in FreeBSD. I often read the advice that one should disable write-back caching on modern disks in order to make softupdates actually work. Unfortunately, disabling the write-back cache on typical ATA/SATA consumer disks involves a severe performance hit (my Seagate SATA drive here drops to 1/5th sequential write speed, probably worse for a random workload, and so this workaround isn't really an option.) Now I've stumbled across: http://lkml.org/lkml/2005/5/15/88 in which someone claims that FreeBSD "used ... write barriers long ago". Write-barriers are a kind of synchronization point around critical writes (i.e., those which need to be kept in a certain order), where the block level drivers disable (or flush) the cache before the barrier, and reenable it afterwards. Windows has been doing that for a long time in order to make their NTFS halfway reliable (amazing that they got something right). Linux apparently also has write-barriers, although for SATA only in the most recent 2.6 kernels. Now my question is: Does FreeBSD also implements these barriers, or an equivalent mechanism, as claimed on the above URL? If it does, why then the frequent advice to disable write-back caching? Or is that only for the couple drives that ignore any flush cache/disable wb commands? I know my drive doesn't ignore that command (since performance drops sharply, when I disable the cache), so I would be on the safe side. Would it be possible to get an authoritative statement from a FreeBSD developer here on that matter? Thanks. mkb.