ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Flash wear level

To:
Subject: Re: [ts-7000] Re: Flash wear level
From: Michael Schmidt <>
Date: Mon, 09 Feb 2009 12:30:26 -0700
Jim Jackson wrote:
> 
> 
> On Mon, 9 Feb 2009, Alan Dayley wrote:
> 
>> On Mon, Feb 9, 2009 at 10:14 AM, Jim Jackson <> wrote:
>>> That's good. Re-using just a small percentage of a large flash card, allows
>>> the wear leveling to cycle thru' a higher percentage of free blocks, and so
>>> means the flash lasts longer.
>>>
>>> One of the worse situations is to have a card 95% full with static data,
>>> and you are rewriting data in the remaining 5%. The wear levelling can only
>>> cycle round the small percentage of free blocks, so they wear out quicker.
>> The wear-leveling behavior you described here is known as "dynamic
>> wear-leveling."  This means the empty or unused flash blocks and the
>> blocks that are dynamic, or changing, in the current transaction are
>> the only ones involved with the wear-leveling by the controller.  Some
>> controllers also include any spare reserve blocks in the dynamic
>> wear-leveling.
>>
>> As of a few years ago, a better algorithm has been deployed by most
>> flash controller makers.  This is known as "static wear-leveling" and
>> includes ALL flash blocks, including those with static data.  In
>> static wear-leveling the writes are moved all around the flash media,
>> even moving around previously written blocks of user data.  This
>> obviously improves the spread out of the wear on the flash.
> 
> Thanks for this, I'd not come across static wear-leveling, but google 
> provides :-)
> 
> It does of course imply added time for writes where there is lots of static 
> data.

Well at first I was going to say that it would also seem to imply 
reduced overall flash lifetime, as internally the wear-leveler is doing 
additional erases and writes on blocks that otherwise would be left 
alone.  But after running a simple thought experiment I can't see how it 
would even provide any better wear-leveling.

For example, suppose you had a flash with only 4 blocks, and each has a 
lifetime of 10 writes.  If 3 blocks are in use, then if you repeatedly 
re-write the 4th block it will wear out faster.  Specifically, you will 
get 10 writes before the 4th block is worn out and (since there are only 
4 blocks) the device is declared unusable.  But if you erase other 
blocks does it really help?   No, because whatever block you erase to 
write the 4th block, you now have to write into the 4th block.  Now 
after 10 writes, two blocks will be bad instead of one.

If only 2 blocks are in use, then alternating between blocks 3 and 4 
will give a total of 20 writes until the flash is full.  But if you 
repeatedly erase block 1 or 2 in order to put the new block, you still 
have to put the contents of that block somewhere, either block 3 or 4. 
So now you get 30 writes, but 10 of those are writes required to move a 
block.

Hopefully the above description of how this works either has been 
simplified and is missing the key to what makes it work, or else whoever 
designed this algorithm is better/more rigorous at their math than me. ;-)



  ______   Best Regards,
|__  __/                  Michael Schmidt
    ||                   Software Engineer
    ||echnologic Systems (EmbeddedARM.com)
    || (480)        16525 East Laser Drive
    |/ 837-5200   Fountain Hills, AZ 85268
        http://oz.embeddedarm.com/~michael


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU