Re: [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: guillaume.belleteste
CC: yaffs
Subject: Re: [Yaffs] Checkpoint block allocation
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 :     , 
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