Hi,
There is a bug in YAFFS2 in GC implementation.
While checking the block, whether its qualified for GC(in the function
yaffs_BlockNotDisqualifiedFromGC), we are supposed to find
the oldest dirty sequence number. But in the present
implementation, we are finding only the oldest sequence
number.
Hence, it needs to be changed to find the oldest dirty sequence
number as under.
Current Implementation
--------------------------------
"if (b->blockState == YAFFS_BLOCK_STATE_FULL &&
(b->pagesInUse - b->softDeletions) <
dev->nChunksPerBlock && b->sequenceNumber <
seq)"
Required Implementation(To find Oldest Dirty Sequence Number)
-----------------------------------------------------------------------------------------
"if (b->blockState == YAFFS_BLOCK_STATE_FULL &&
(b->pagesInUse - b->softDeletions) <= (bi->pagesInUse -
bi->softDeletions) && b->sequenceNumber <
seq)"
After disk is been used for long time(multiple usages), even if the
disk has the valid Block for the GC having sequence number
newer than the oldest sequence number, then this block is
not qualified for GC(with Current Implementation). This
also leads to poor write performance...
I have tested with the modified implementation, and is working
consistantly fine with proper disk usage and also with improved write
performance.
Hope this makes sense...
Regards,
Asif