FLASH disk as swap

Alan Dayley alandd at consultpros.com
Thu Dec 10 07:28:27 MST 2009


On Thu, Dec 10, 2009 at 3:21 AM, Marco Savo <savomarco at gmail.com> wrote:
> Thanks for the info.
> I had to find the time for read all the mails.
> I also found some useful info on internet:
> http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space?theme=print
> http://www.xenotime.net/linux/doc/swap-mini-howto.txt
> http://robert.penz.name/137/no-swap-partition-journaling-filesystem-on-a-ssd/
>
> I'm working on an embedded router using openwrt. This router has an
> internal Nand flash of 1 GB.
> I remembered, using openwrt and asterisk on an asus 500 gl, and using
> an usb stick as storage and linux swap. So I was just curious if I
> could do the same here, and if was necessary. I guess in my case is
> not applicable, this is a cheap flash and I think has 100 thousand
> writing cycle. ( so from your answers this is not suitable, right?)
> Well, I'm not just curious. In some cases I had the OOM killer going on.
> I also improved a little bit with this:
>
> echo 3 > /proc/sys/vm/drop_caches
>  *******To free pagecache, dentries and inodes: This is a
> non-destructive operation and will only free things that are
> completely unused ************
>

Almost all NAND flash has a write endurance of 100,000-300,000 writes.
 More specifically, it is erase endurance.  In your case I am curious
about the interface to the flash.  If you don't have a good flash
controller between your processor and your flash, the firmware has to
do all the management.  If your firmware is doing the management,
DON'T use it as swap.  Without a dedicated controller doing ECC for
error correction, wear-leveling, managing spares, etc., the firmware
will not be doing it well and the flash will wear out.

Alan


More information about the PLUG-discuss mailing list