Subject: Re: File system performance on i386
To: Jarom?r Dolecek <jdolecek@netbsd.org>
From: Christoph Hellwig <hch@lst.de>
List: tech-perform
Date: 02/23/2001 10:43:07
On Fri, Feb 23, 2001 at 10:13:12AM +0100, Jarom?r Dolecek wrote:
> Christoph Hellwig wrote:
> > More or less. Actually it avoids ffs complexity where it is not worth the
> > effort with modern hardware/OS-Design (fragments, knowledge of physical
> > media layout)
> 
> IIRC ext2fs doesn't have fragments, but some quite similar concept.

No.  Ext2 uses smaller blocksizes and tries to allocate them more
contingous instead.

> > - unlike synch metadata the io is done in (mosty) the same
> > order - of metadata is actually recoverable by a good fsck anyway.
> > Basically what Linux does is softdep for the poor.
> 
> The problem is that since the metadata are written asynchronously
> (read as "at some undefined time in future" and "at undefined
> order"),

Due tue the caching alogoriths it is usually written in order -
unlike synch were the synch metadata may hit the disk _before_ the
actual data is commited.  That is bad.

> it may not have hit the disk yet after the change or may
> only hit the disk partially. So you CAN'T recover it.

It may not be there.  True.  It is on the other hand no real problem to
lose some metadata update - unlike having the metadata without the data.  

> If you write
> metadata synchronously (read "immediatelly"), you can be sure all
> the changed metadata HIT the disk, so potential crash or anything
> is not such disastrous.

Why do you thing metadata about not written data will help you in
recovery?

> softdep maintains best of both words - it
> postpones writing the metadata similar way as async does, but writes
> all related metadata together, so that it garantees the state on
> disk is consitent.

True.

> Try sometimes some bigger disk activity (say, some untarring, deleting)
> on Linux and BSD. Hit the power switch in the middle of operation.
> Then compare the results on Linux and BSD after the disks are
> fscked :)

I usually lose more data on NetBSD - but fsck doesn't even NOTICE
all lossage.

> 
> If you really really think async metadata is the way to go, you can
> mount async if you prefer to. IIRC there is no option to write
> only metadata sync on ext2fs under Linux though.

mount -o sync

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.