On Tuesday 04 October 2005 19:52, Chris Williams wrote:
> Hello,
>
> A tad off-topic to this list, but I wanted to ask about the relative
> benefits between using a flash-centric file system versus a translation
> layer.
>
> The YAFFS page just says that a translation layer was considered, but in
> the end a file system seemed better, without any embellishment.
FTLs "tell lies" to make a chunk of flash look like a block device (== disk
device) to support a regular fs such as FAT (a typical scenario for USB mass
storage devices etc). Keeping these lies consistent takes effort (== runtime)
needs extra management data to provide the logical to physical mappings. This
causes two problems:
1) runtime efficiency (eg measured by write speed) is impacted.
2) the logical to physical mappings can get corrupted which causes data loss.
Further, even the best FTLs (??DiskOnChip??) still only provide a solution as
good as the file system on top. FAT, a pretty commonly used one, is pretty
tragic. These systems are typically not at all robust to power loss or device
removal. If you pull a USB mass storage device from a PC while it is busy,
you'll soon see what I mean :-).
A flash file system like YAFFS or JFFS2 does not use any FTL layer so there
are no "lies". This means that YAFFS typically has a better write speed than
a FAT-based system. There is also no FAT or similar to get corrupted. Actual
operations in progress will obviously get corrupted, but the file system
integrity is not compromised.
>
> I have been asked to create a small (code-size) and otherwise memory
> friendly filesystem for a DINOR IV device, which appears to have a lot
> of the pitfalls of NAND removed (ECC, sequential writes, limited page
> write count, etc.) I am currently guessing that the reason a translation
> layer wouldn't be so friendly is that you have to use 512 bytes for
> every update to the translation table with NAND, even though you would
> probably only be using a very small amount of that. However, for the
> device I am writing for, it appears to be that I can do byte-level
> access, so this wouldn't be an issue.
I have not looked at the DINOR device, but here are some things to consider:
1) Do you need a full-blown fs? If you're just storing a few simple files and
don't need the capabilities of a full file system, then using a file system
is often overkill and a Linear FIle Store might be more appropriate.
2) Do you need to be FAT compatable (eg. is this a USB Mass storage device, if
so you're hands are pretty much tied).
3) How important is data integrity? If data loss turns your device into aen
expensive brick, then you want a robust fs.
4) How important is performance etc?
Quite a few people have used YAFFS on NOR devices with great success. You
might want to try doing a trial build and seeing how things go.
-- CHarles