On Wed, Jul 29, 2015 at 1:46 AM, <guillaume.belleteste@non.schneider-electric.com> wrote:
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

Hello

The checkpoint is always written starting in the first available blocks that can be found. This can indeed cause extra wear on these blocks if the checkpoint is written often.

The reason behind doing this was two-fold:
1) Starting at the first available erased block means the checkpoint is always written sequentially. There might be other data blocks in between, but we know we only have to proceed sequentially when searching for checkpoint data. This simplies and speeds the checkpoint reading.
2) Having the checkpoint blocks near the beginning means we search less blocks to find them. Again that gives speed.

I am thinking through what can be done to move the checkpoint blocks around without too much compromise.

In the mean time, it is worth looking at two things:
1) How often are you writing checkpoints? If you're doing it often then why? There is generally little point in writing checkpoints often.
 
2) Consider disabling checkpoints all together. Since the introduction of block summaries, there is less benefit in using checkpoints. Checkpoints do give a faster boot than summaries, but not by much.

See http://www.aleph1.co.uk/lurker/message/20110515.215942.a1e065e4.en.html

All systems are different, so YMMV.

Regards

Charles





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