Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Jul 2005 15:18:53 +0200
From:      Matthias Buelow <mkb@incubus.de>
To:        freebsd-questions@freebsd.org
Subject:   disk write barriers
Message-ID:  <200507061318.j66DIrHx000895@drjekyll.mkbuelow.net>

next in thread | raw e-mail | index | archive | help
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.



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