Re: [Yaffs] Re: checkpoint question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
CC: Wookey
Subject: Re: [Yaffs] Re: checkpoint question
To correct Wookey slightly...

On Saturday 16 September 2006 05:24, Wookey wrote:
> On 06-09-15 16:23 +0200, Johann Kok (JP) wrote:
> > Hi all,
> > 1) If I understand checkpointing correctly and I disable checkpointing
> > the only penalty I will pay is bootup time, right?
>
> Correct.
>
> > 2) I will also get an added block or two to use for data, right?
>
> Correct. Exactly how much space checkpointing uses depends on the size
> of your filesystem.
>
> > 3) How can I disable checkpointing?
>
> You could originally do this (quoting Charles:)
> by setting the checkpoint and main areas to overlap. eg:
>
>          dev->checkpointStartBlock = 0;
>      dev->checkpointEndBlock = 0;
>      dev->startBlock = 0;
>          dev->endBlock = nBlocks - 1;


The first cut checkpointing used a seperate region to store the checkpoint
data, so the above would deny any space for checkpointing and thus defeat
checkpointing.

However, as Wookey says, that method is now obsolete and does not apply any
more..

> However then it got updated to chop of a chunk by itself for use.


To be slightly more correct: it does not "chop off" a section -- which implies
a contiuous lump of NAND. Instead it just uses erased blocks of NAND that
would otherwise be used for data and that ends up with the checkpoint data
interwoven with the regular data. As soon as the checkpoint data is
invalidated, it is respored to general use.

>
> So now you set
>
>    nCheckpointReservedBlocks to 0

>
>    for the yaffs device in question. (see yaffs_guts.h)


This does not prevent checkpointing from happening, but just prevents any
space being reserved explicitely for checkpoint data.

If nCheckpointReservedBlocks is zero, then the NAND allocation algorithm will
not reserve any blocks for the checkpoint data. What this means is that
sometimes there will be space for a checkpoint, and sometimes there won't.

So if you set nCheckpointReservedBlocks to zero you will get full usage of
flash for data storage, however if it is not all used ( and there are
sufficient erased blcks free) then the checkpoint will happen. These will be
freed up for data as soon as the checkpoint is invalidated (by writing
anything to the flash).

That is likely the scenario you want.

If, however, you **always** want to prevent checkpointing, then you'd do
better to comment out the call to checkpointing in the unmount.

-Charles