|
Re: Garbage collection issue.: msg#00010linux.file-systems.yaffs
Charles, Thanks so much for getting back to me. I should have sent this out sooner and I do apologize. I was out of the office all of last week at Embedded Systems Conference in San Francisco and spent the entire week before that getting ready for the show. Now I'm back to working on this issue. I checked and my YAFFS device is being set as follows: - block size is = 0x40000 - nbytesPerChunk = 512 - nChunksPerBlock = 496 ( 0x40000 / (512 + 16) ) - nReservedBlocks = 3 - startBlock = 1 - endBlock = 31 - useNANDECC = 0 - nShortOpCaches = 0 I enabled all sorts of debug output throughout the driver. It appears that garbage collection *should* be working fine. When a garbage collection cycle happens, it appears that YAFFS grabs the first block of flash. It copies the data from the block to another section of flash, and then erases the entire block. Subsequent garbage collections start with the next sequential block of flash. Two things appear a little bit fishy to me: 1) The entire block isn't copied before erasing. I put messages in the code that say things like, "copying page %d" in the function yaffs_GarbageCollectBlock(). The first block that gets collected is block one and it starts by copying page 496. Then, pages are copied in succession up to 735. Notice, that it didn't copy the entire block's worth of pages. Maybe this is normal. Perhaps YAFFS split the file data up between different blocks of flash. You will have to tell me. I would have expected it to copy all the way up to page 992 (the last page in the block). That is, of course, assuming that YAFFS would put as much data as possible into a block. 2) dev->nErasedBlocks doesn't appear to get updated. The first time the garbage collector runs, I see this message: "yaffs: GC erasedBlocks 30 aggressive 0" After that, *every* time it runs, I see the same message: "yaffs: GC erasedBlocks 29 aggressive 0" I would expect to see the "erasedBlocks" output increase or decrease. I guess right now I'm just looking for some advice on how to proceed. As I mentioned before, I *only* seem to have problems when the garbage collector runs. Turning it off lets me burn huge files into the filesystem without trouble. The problem caused by the garbage collection seems to be loss of data within the file. To try and help me figure out what was going on, I created a large text file that just goes something like this: line #0 line #1 line #2 .... .... line #102397 line #102398 line #102399 I then copy this file from a FAT formatted Compact Flash card into the YAFFS partition. When I look at the size of the file after the copy, YAFFS reports to me what would be the correct size. However, the md5sum of the file in the YAFFS partition does not match that of the file in the FAT partition. Further more, when I textually dump the file to the serial port and capture it, I can see that huge chunks of data are missing in the YAFFS version of the file. The dumped file looks something like: line #0 line #1 .... .... line #33307 line #33308 line #3330ne #43891 line #43892 line #43893 .... There are a couple of more gaps in the data like that. Might this have something to do with those "missing" blocks of data that I observed not being copied before the block erase? Again, if I disable all garbage collection, I can burn the exact same file with no trouble. The md5sum will match, dumping it to the serial port and comparing it on my desktop will show me that the file was truly copied without error. Any help or advice on where to look next would be greatly appreciated. Best regards, --mike Charles Manning wrote: Mike -- Michael Erickson Senior Software Engineer Logic Product Development (612) 436-5118 mailto:mikee@xxxxxxxxxxx http://www.logicpd.com This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | YAFFS and HW ECC: 00010, Roberts Nathan-mcg31137 |
|---|---|
| Next by Date: | partial yaffs porting: 00010, hariharan veerappan |
| Previous by Thread: | YAFFS and HW ECCi: 00010, Roberts Nathan-mcg31137 |
| Next by Thread: | Re: Garbage collection issue ==> fixed: 00010, Charles Manning |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |