[Nottingham] Writing into FLASH!

Martin martin at ml1.co.uk
Thu Sep 17 20:49:12 UTC 2009


OK, the optimisations quest continues, but it has also stirred a 
question or two... ;-)


For using flash devices (SSDs, memory sticks, USB keys or whatever name 
you wish), one issue is their limited write cycles lifespan and the 
killer of "write amplification".

A good brief explanation is on:

http://www.extremetech.com/article2/0,2845,2329594,00.asp

And a few glib numbers and comments are here to say that the latest 
devices are cheap enough that there's no worry in any case!

http://www.dansdata.com/flashswap.htm


The interesting bit is... What is done with wear levelling or whatever 
to avoid the rampant write amplification when you have a filesystem 
writing 4kByte blocks onto a full flash device that has (for example) 
512kByte erase blocks?

When the device is 'empty', then there is no problem. Each 4kByte block 
can be simply written. However, after you've written enough data to fill 
the device, thereafter an erase block (512kBytes say) must be erased 
before you can write any new data. Also note that the device doesn't 
know anything of what data areas are no longer in use because it has no 
way of knowing. There is the "TRIM" command promised, but I doubt that's 
in use anywhere yet. So... What happens when you have a 4GB memory stick 
after you've written 4GB of data to it?


TRIM:
http://en.wikipedia.org/wiki/TRIM_(SSD_command)


Aside:

How would you get direct access to the flash chips to be able to take 
advantage of YAFFS or JFFS?

http://www.yaffs.net/
http://sourceware.org/jffs2/


I guess this little lot has got to be worth a talk!

Cheers,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list