Hello,
After some reflexion, I think this behavior is normal since it is use to increase the speed up of yaffs partition. Each new Checkpoint is write to the first next block available from the beginning of the file system, breaking a little bit the wear-leveling strategy.
My test perform a lot of write leading to a lot of new checkpoint write to the same blocks located at the beginning of file system
Regards,
Guillaume
De : Guillaume Belleteste/FR/Non/Schneider
A : yaffs@lists.aleph1.co.uk,
Date : 30/06/2015 10:46
Objet : Checkpoint block allocation
Hello,
I'm using yaffs2 on a 2GB flash on Vxworks.
As I have a high requirement on flash lifetime, I made some statistics on erase count by block and I noticed than one or very few blocks at the beginning of the file system was erase much (much) more than other blocks. Atfer few inverstigations, it seems that it is the checkpoint wich erase always the same block. (to give some numbers, lets says the block 0 was erase 1000 times whereas the others was erase only 10 times)
To make the stats, I run a simple program like this (no other write during the test):
open file
while (1)
write 20KB
sync
close file
The debug allow me to see that the function "yaffs2_checkpt_open()" always reset the field "checkpt_next_block" and the function seems to be called every times (probably at each sync).
So I made a quick (and probably ugly) workaround
if (dev->checkpt_next_block < dev->internal_start_block)
dev->checkpt_next_block = dev->internal_start_block;
The question is the following:
Is it a normal behavior and it is normal that the open function always reset the next block for checkpoint ?
Thank you
Regards,
Guillaume
_______________________________________________
yaffs mailing list
yaffs@lists.aleph1.co.uk
http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs