Hi All,
I'm run into the problem with GC usage in
yaffs2, which is causing the lower write performance.
When the disk(NAND) is in fully erased state(i.e,
0% usage), i will get the higher write performance,
but as the usage increases, performance is
gradually decreases. I am just trying to copy some files,
delete and then copy again.
I also did an experiment by commenting GC during
file write, which leads to consistently higher
performance. From this its clear that GC is the one
which is causing the problem.
I am thinking of following approaches to
address this issue. Please correct me if i'm wrong
1. I tried the GC during
SoftDeleteWorker context.
i.e, in the function
"yaffs_SoftDeleteChunk" after incrementing the "softdeletion"
parameter
of the block information, call
yaffs_CheckGarbageCollection
I have tried this method to
minimise the GC load during file write (i.e, the load on
yaffs_WriteChunkDataToObject)
2. While observed during
Garbage Collection that, even if the pagesInUse of
a block becomes ZERO
(i.e, bi->pagesInUse
- bi->softDeletions in "
yaffs_FindBlockForGarbageCollection" function,), in
function
yaffs_GarbageCollectBlock, we are reading all the chunks and
decrement the nDataChunks
counter of the correcponding
object.
I am just wondering is it
possible to remove this overhead (reading all the chunks while the
pagesInUse
of that block is zero) by
updating the nDataChunks counter while softDelete of the corresponding
object,
and erase the block directly while the
pagesInUse of that block are zero.
Also i am wondering, will the above two approaches
cause any abnormal behaviour in any other context.
Thanks,
Asif