[prev in list] [next in list] [prev in thread] [next in thread] 

List:       yaffs
Subject:    Re: [Yaffs] Checkpoint block allocation
From:       Charles Manning <cdhmanning () gmail ! com>
Date:       2015-07-30 22:02:55
Message-ID: CAE21AQrDFdf8cF0munofU-R99nh7BQeLJBttVoE9zG7Jdh907g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul \
29, 2015 at 1:46 AM,  <span dir="ltr">&lt;<a \
href="mailto:guillaume.belleteste@non.schneider-electric.com" \
target="_blank">guillaume.belleteste@non.schneider-electric.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Hello,</font> <br>
<br><font size="2" face="sans-serif">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.</font> <br>
<br><font size="2" face="sans-serif">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</font>
<br>
<br><font size="2" face="sans-serif">Regards,</font>
<br><font size="2" face="sans-serif">Guillaume</font></blockquote><div><br></div><div>Hello<br><br></div><div>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.<br><br></div><div>The reason behind doing this was two-fold:<br></div><div>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.<br></div><div>2) Having the checkpoint blocks near the \
beginning means we search less blocks to find them. Again that gives \
speed.<br><br></div><div>I am thinking through what can be done to move the \
checkpoint blocks around without too much compromise.<br><br></div><div>In the mean \
time, it is worth looking at two things:<br></div><div>1) How often are you writing \
checkpoints? If you&#39;re doing it often then why? There is generally little point \
in writing checkpoints often.<br>  <br></div><div>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.<br><br></div><div>See <a \
href="http://www.aleph1.co.uk/lurker/message/20110515.215942.a1e065e4.en.html">http:// \
www.aleph1.co.uk/lurker/message/20110515.215942.a1e065e4.en.html</a><br><br></div><div>All \
systems are different, so \
YMMV.<br><br></div><div>Regards<br><br></div><div>Charles<br><br></div><div><br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <br>
<br>
<br><font color="#5f5f5f" size="1" face="sans-serif">De :         
  </font><font size="1" face="sans-serif">Guillaume \
Belleteste/FR/Non/Schneider</font> <br><font color="#5f5f5f" size="1" \
face="sans-serif">A :           </font><font size="1" face="sans-serif"><a \
href="mailto:yaffs@lists.aleph1.co.uk" target="_blank">yaffs@lists.aleph1.co.uk</a>, \
</font> <br><font color="#5f5f5f" size="1" face="sans-serif">Date :         
  </font><font size="1" face="sans-serif">30/06/2015 10:46</font>
<br><font color="#5f5f5f" size="1" face="sans-serif">Objet :      
     </font><font size="1" face="sans-serif">Checkpoint block
allocation</font>
<br>
<hr noshade>
<br>
<br><font size="2" face="sans-serif">Hello,</font>
<br>
<br><font size="2" face="sans-serif">I&#39;m using yaffs2 on a 2GB flash on \
Vxworks.</font> <br><font size="2" face="sans-serif">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)</font>
<br>
<br><font size="2" face="sans-serif">To make the stats, I run a simple program
like this (no other write during the test):</font>
<br>
<br><font size="2" face="sans-serif">            open
file</font>
<br><font size="2" face="sans-serif">            while
(1)</font>
<br><font size="2" face="sans-serif">              
         write 20KB</font>
<br><font size="2" face="sans-serif">              
         sync</font>
<br><font size="2" face="sans-serif">            close
file</font>
<br>
<br><font size="2" face="sans-serif">The debug allow me to see that the function
&quot;<b><i>yaffs2_checkpt_open</i>()</b>&quot; always reset the field
&quot;<i>checkpt_next_block</i>&quot; and the function seems to be called
every times (probably at each sync).</font>
<br><font size="2" face="sans-serif">So I made a quick (and probably ugly)
workaround</font>
<br>
<br><font size="2" face="sans-serif">            if
(dev-&gt;checkpt_next_block &lt; dev-&gt;internal_start_block)</font>
<br><font size="2" face="sans-serif">              
         dev-&gt;checkpt_next_block = dev-&gt;internal_start_block;</font>
<br>
<br><font size="2" face="sans-serif">The question is the following:</font>
<br><font size="2" face="sans-serif">Is it a normal behavior and it is normal
that the open function always reset the next block for checkpoint ?</font>
<br>
<br><font size="2" face="sans-serif">Thank you</font>
<br>
<br><font size="2" face="sans-serif">Regards,</font>
<br><font size="2" face="sans-serif">Guillaume</font>
<br><br>_______________________________________________<br>
yaffs mailing list<br>
<a href="mailto:yaffs@lists.aleph1.co.uk">yaffs@lists.aleph1.co.uk</a><br>
<a href="http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs" rel="noreferrer" \
target="_blank">http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs</a><br> \
<br></blockquote></div><br></div></div>



_______________________________________________
yaffs mailing list
yaffs@lists.aleph1.co.uk
http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic