Subject: Re: using swap with hpcmips
To: None <tv@wasabisystems.com>
From: M. Warner Losh <imp@village.org>
List: port-hpcmips
Date: 02/05/2002 08:40:30
In message: <Pine.WNT.4.43.0202050959030.1112-100000@todd>
            Todd Vierling <tv@wasabisystems.com> writes:
: Swapping to a CF is guaranteed to nuke your CF card's lifetime awfully
: quick.  (Hopefully, you also have filesystems mounted noatime and
: nodevmtime, or else it'll die even faster.  :)  Flash pages only have a
: rewrite lifetime in the 10^6 range, and even without using a lot of memory,
: NetBSD will still chug pages in your swap area all the time.

I've populated a FreeBSD CF with a system, and then was able to do
10,000,000 writes to a file system (which is actually two writes since
I was doing an fsync() and the meta data was updated) without ill
effect.  I still use that CF part and it has kept working for the 10
new systems I've burned onto it.  We've put about 11M writes into that
part.  We had a 10M write target for the application I was doing the
testing for.  While FreeBSD with a CF card in an IDE adapter, it
should be no different than NetBSD because they are both using the
same write commands...

Most of the CF parts do wear averaging, which is why I was able to do
what I did.  If you need swap, it will be very slow (CF write speed is
in the ballbark of 200kB/s), you can enable it without worrying too
much.  For $100 parts (the 256M part I bought last week was that
much), you'll get a certain amount of time out of it.

Having said that you can do it, Todd is right that you likely want to
be careful about how you do it.  We don't enable swap on our CF
systems, mount / readonly and have most of the changing data in RAM
(we do have a little config data on a writable partition, but the
write rate to that partition is about 1-2/day or so).  When the part
goes bad, it goes bad (no writes) and you need a new one in a hurry.
It is surprisingly hard to buy two identical CF parts (in terms of
disk geometry) when you are buying them 6-12 months apart.  If the
parts aren't identical, you are left with the fdisk + disklabel +
dump/restore dance.

Warner