[Yaffs] Checkpoint block allocation

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: guillaume.belleteste@non.schneider-electric.com
Date:  
To: yaffs
Subject: [Yaffs] 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