Subject: Re: NetBSD file system on z50
To: godwin <godwin@orcawerks.com>
From: Warner Losh <imp@village.org>
List: port-hpcmips
Date: 04/20/2000 21:26:19
In message <20000421030452.84352.qmail@hotmail.com> "godwin" writes:
:     Is the file system used NetBSD currently is optimized for Flash? or it
: doesn't really matter?

Doesn't matter for CF technology where the durability of the flash is
relatively high.  But no, it isn't optimized for flash.  It doesn't
support the flash file systems that are out there.  Softupdates could
be viewed as an optimization that helps flash because it eliminates
unnecessary writes, but that's a stretch.  It doesn't to the wear
reducing techniques of writing from beginning to end and then GCing
things.  It packs things towards the front (all ufs systems do this
that haven't been changed radically from the BSD code base).  lfs
might solve some of these issues, but that's not a commonly used file
system (I don't even know if it is working in NetBSD or not).

: write to the cards (has anyone busted one of those cards yet?). 

I've broken two DOC2k chips, but so far have been unable to wear out a
CF card.  They are too expensive to do destructive testing on :-)

: So we would
: want to minmize swapping and fragmentation right? 

Eliminate swap writes.  Fragmentation isn't bad.  ufs isn't a log file
system, so it tends to keep things smushed up at the front of the
volume, concentrating the wear on the flash there.  Fragmentation
doesn't hurt things too much and doesn't tend to be a significant
player in the wear patterns that I've seen.

On the embedded systems we do, we mount / read only, have two small
partitions for read/write that mirror each other in case one wears
out.  We don't swap, since that is bad bad bad bad bad bad for flash
life.

: But right now as far as I
: can figure out Windows and even NetBSD just treat the CF cards as normal
: hard discs right?

Yes.  NetBSD considers the CF cards a block device that have a
programming interface the same as an IDE ATA drive.  Windows 9x does
approximately the same thing unless you've installed special
drivers. Rumor has it that WinCE will memory map the devices, but I've 
not looked into the from a hardware or software point of view so I
don't know.

: On the upside flash is much faster access time than hard
: discs, so what we consider long/ big overhead operations in hard discs would
: be minimal in CF right?

Flash is much slower than hard disks for write, since one can only do
about 200kB/s to the CF cards.  For reads, the cards aren't too bad,
but still a little slow.

: I don't know enough about *NIX filesystem to comment, that's why I like to
: find out! :-)

How my answers were useful and accurate.

Warenr