[geeks] Flash wear leveling

Jochen Kunz jkunz at unixag-kl.fh-kl.de
Fri Feb 22 03:15:45 CST 2008


On Thu, 21 Feb 2008 17:27:58 -0500
"Alois Hammer" <aloishammer at gmail.com> wrote:

> * My best guess, based on available information, is that if I start
> tossing UFS or ext3 or other filesystems onto flash memory, wear
> leveling goes out the window.
No.

The controlers do wear leveling at the logical-to-physical block
translation level. At work we developed a solution to stream video to
CF and SD cards. We tested several file systems (ext2/3, xfs, reiserfs,
FAT, ...) and finaly gave up. The cards do internal caching of blocks
for the wear leveling in a (from the outside) unpredictable manner.
At some times write throughput droped through the flor because the card
internal cache was filled and the card controler started to shuffle
blocks around and write them to Flash. This is multiplied by the (Linux)
kernel internal block buffer cahce. ("Write storm")

Finaly we gave up and developed an application speciffic log structured
file system in userland. It fills the card in a long linear write from
the begining to the end and then starts to overwrite from the beginning.
I.e. the CF card is used as a circular buffer. Also: Sometimes we got
corrupted fliesystems on CF cards. Most likely because of the card
internal cache algorithem was buggy... Linear writing is easy to handle
for the card and gives best, constantly high throughput.

Using the card as a general purpose file storage with only occasional
writes is no problem.
--


tsch|_,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/



More information about the geeks mailing list