Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2000 08:18:51 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        sos@freebsd.dk (Soren Schmidt)
Cc:        tlambert@primenet.com (Terry Lambert), archie@whistle.com (Archie Cobbs), fs@FreeBSD.ORG, sos@FreeBSD.ORG
Subject:   Re: disable write caching with softupdates?
Message-ID:  <200009200818.BAA27874@usr01.primenet.com>
In-Reply-To: <200009200745.JAA44730@freebsd.dk> from "Soren Schmidt" at Sep 20, 2000 09:45:33 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> > > Isn't it safer (in the face of a power failure) to disable write
> > > caching on a hard disk when softupdates is in use?
> > 
> > Yes.  You _must_ guarantee that the drive does not complete
> > writes out of sequence that it reports having completed in
> > sequence.  Hardware which lies is evil.
> 
> Hmm, the write caching on ATA drives (if they support it at all,
> very few actually does), is guarantied to be able to write the
> data to disk on power failure, or at least so they say, and I've
> not been able to prove otherwise.

The ATA drives Whistle is using, which is what I'm assuming
Archie is on about, do _not_ support this facility.  As far
as I can tell, there wre some SCSI drives manufactured by
IBM at one time which could do this, and some lab drives at
Quantum (also SCSI).

The InterJet II _specifically_ uses a non-standard power
supply to obtain an AC fail notification in sufficient time
so as to not schedule additional writes over a DC failure
event.

In fact, both the Quantum and now IBM drives which are used
in the InterJet II (both ATA drives) fail catastrophically
on a power loss during a sector write, to the point of you
potentially needing to reformat the sector, if you were so
unwise as to be writing when DC to the drive dropped.

The only way to get rid of this requirement is either to use
a Journalled FS (you might remember me being upset about the
IBM announcement of JFS being released under GPL, before we
found out that it was the OS/2 JFS, and not the good one), or
to do intention write logging to NVRAM (also expensive in
terms of hardware).  The only bonus is that the new power
supply costs a lot less than the UPS in the InterJet I.


> > > The ata driver currenly always enables write caching. Perhaps
> > > there should be a sysctl knob to turn it on/off?
> > 
> > Write caching should _never_ be enabled, unless you don't
> > care about the data, or the drive reports the operation
> > queueing and completion seperately, so that the OS knows
> > the completion order; even then, the OS will have to be
> > prepared to stall writing new data until completion has
> > occurred at any given synchronizatin point, so that it is
> > impossible for the drive to complete the requests out of
> > the order permitted by the OS.
> 
> Hmm, they way this (should) work in ATA drives there should
> be no such problem, and I've never seen it, and belive me I've
> treid hard to provoke problems this way...

I don't think this is enough to ship 100,000 units to customers
in the field; absence of evidence is not evidence of absence,
and the drive manufacturers specifically state that a 1 sector
corruption is possible if a write is occuring during DC failure.
It sucks, but it's true.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




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