|Authored by: DieterWasDriving on Wednesday, November 07 2012 @ 03:18 PM EST|
Yes, write cycles are really erase-write cycles.
But you misunderstand how wear-leveling works.
Hidden moves are taking place internally so that frequently written logical
sectors refer to different physical sectors over time. Rarely written logical
sectors are internally copied to new physical locations, so that their
little-used sectors are available to the wear-leveling mechanism.
When the operating system references a "disk block", the device uses a
redirection table to look up the physical section of memory that actually stores
the data. That allows the wear-leveling firmware freedom to do this shuffling.
There is an hidden cycle counter associated with each flash block, and an
average-wear counter. Once a physical block write count goes significantly
above the average, the device firmware finds a little-used block (which
presumably is part of a rarely updated system file) and copies the data to the
The algorithms can be considerably more complex than this simple model,
identifying frequently written logical blocks and grouping sectors into larger
blocks that are frequently accessed together e.g. are likely part of the same
file. But the basic idea is that a block the OS thinks is at a specific sector
address is actually migrating over the physical memory locations.
[ Reply to This | Parent | # ]
|Authored by: Anonymous on Thursday, November 08 2012 @ 08:51 AM EST|
|Couple of points here - older larger geometry flash used to |
have 100k Erase cycles but modern <20ns devices it is more
like 3000 Erase cycles.
The data is written page by page and each page must be
written in one go. Pages must be written sequentially into
the Erase block - typically 256 pages to an Erase Block. The
page size varies and may be anything from 2k up to 32k in
size. One technique used to ensure space is available for
moving data is to overprovision. In enterprise drives this
is likely to be 25% or more - consumer drives only 7%.
If you buy a 128 GByte drive you get access to 120GB the
other 8G is used to allow continuous writing and wear
When you overwrite data to the drive -e.g. paging file - the
drive will mark the old data as invalid and store the new
data in a blank page. When all the pages in a block are
invalid pages the block can be erased and used again. If
nearly all blocks have some used pages then a blank block
can be used to aggregate the valid pages into a single block
to freeing blocks that contained a mix of valid and invalid
pages - this is why over provisioning allows
continuous writing. It also shows write amplification
happening - the data was written to the drive once but has
now been copied internally for a second write to the flash.
Wear leveling also adds to the write amplification. Wear
leveling occurs when some blocks are heavily cycled but some
have had data written once and then never overwritten - the
Operating system might be a good example - is moved so that
the erase cycles of those blocks can be used for the rapidly
changing stored data. Further write amplification occurs as
the drive needs to store the location of the physical data
relative to the logical address - the internal metadata.
It is fairly easy to calculate how much data a drive can
handle - Number of Erase Cycles Maximum x Size of drive/
What is not so easy to estimate is how long before this
limit is reached. Usage pattern summarised as GBytes written
per day. Write amplification will also vary according to
[ Reply to This | Parent | # ]