On Tuesday 12 October 2004 04:13, Daniel Gustafsson wrote: > I am using yaffs/direct. > > I need to reduce the footprint in RAM a lot (maybe by not storing the > complete tnode-list in RAM and increasing pagesize etc.). Any suggestions > how to do that??? > > If you restart the system and you have a flash memory of 1GB, does the file > system then have to read the whole memory to create the original state??? > > I need as much information as possible to establish a good starting point > before trying to optimize. > When I designed YAFFS I tried to keep the footprint as low as I could. I believe that YAFFS uses less RAM than any comparable file system. At present yaffs uses a bit over 4kbytes per 1Mbytes of flash. When you get into hundreds of MBytes of NAND, this can add up to quite a lot. Most of the RAM is used by the Tnode tree. Each "leaf" on the tree is a U16 for each "chunk" (ie.512 bytes) of NAND that is currently in a file. YAFFS2 (in late development) allows you to use larger chunks. So if you use, say, 4kbyte chunks then you only need approx one eighth of the RAM since there will be one eighth the number of chunks for the same flash size. If you can think of useful ways to reduce RAM footprint, I would be more than willing to listen. When the file system is mounted, the whole NAND is scanned to build up the state. This scanning reads just the spare areas in NAND where all the tags are kept. Empty blocks do not need to be scanned. This takes some time, but again I believe this to be faster than any other comparable file system. It is possible to do some sort of "checkpointing" scheme that would save away the information so that it could be retrieved on remount without having to scan the whole NAND. However, that's going to require some development :-). -- Charles