The trouble with discard
The trouble with discard
Posted Aug 19, 2009 17:11 UTC (Wed) by farnz (subscriber, #17727)In reply to: The trouble with discard by ikm
Parent article: The trouble with discard
Take a flash device with 10 blocks. Expose 8 blocks of space; the remaining two blocks go on the clean list. To wear-level an apparently full device, pick the block of the 8 with fewest erase cycles, copy the data into one of your two clean blocks, mark the newly written block as being the logical equivalent of the old block, then put the old block on the trash list.
At the expense of using slightly more erase cycles than would otherwise be the case, I can ensure that all blocks have roughly the same number of erase cycles; this prevents you from wearing out a single block.