> On Mon, May 28, 2001 at 11:11:35AM -0400, Andrew Klaassen wrote:
> > Question: Would it make sense to put the XFS log on a device
> > with write caching turned off, and the main portion of the file
> > system on a device with write caching turned on? From what I've
> > been reading, turning on write caching can give a major
> > performance boost in some cases, but can also seriously
> > jeopardize metadata integrity, defeating the purpose of having a
> > metadata-journalling FS in the first place. Would turning off
> > write caching just for the log get around this problem?
> It won't, because XFS needs to know on the whole volume when a write
> has finished; otherwise it could remove transactions from the log too
> early. A transaction can only be removed from the log when it has
> been safely comitted, and that's hard to find out with write caching.
Andi is correct here, XFS relies on the I/O completion of metadata writes
to determine when it is safe to reuse log space.
Under Irix there is device qualification for running XFS on a disk, basically
running stress tests, power cycling, and checking the filesystem after
recovery (note that checking an unrecovered filesystem does not do you
much good, since the log replay is what makes the filesystem consistent
again). Now there may be well designed write caching disks out there which
do things like push the cache out to a powerdown track using power held
in a capacitor, or taken from the energy of the spindle rotation, but
there are also disks designed for Windows and the 'Your filesystem was
not unmounted cleanly, please shutdown your system before powercycling'
Given a drive which is capable of responding write commands which indicate
if caching is allowed, it would be possible to do something like cache file
data, but not metadata and log I/O. Again, getting very hardware specific.