Wear Leveling
In this lesson, we discuss how FTLs implement wear leveling to ensure the better working of an SSD.
Finally, a related background activity that modern FTLs must implement is wear leveling, as introduced in an earlier lesson. The basic idea is simple: because multiple erase/program cycles will wear out a flash block, the FTL should try its best to spread that work across all the blocks of the device evenly. In this manner, all blocks will wear out at roughly the same time, instead of a few “popular” blocks quickly becoming unusable.
The basic log-structuring approach does a good initial job of spreading out write load, and garbage collection helps as well. However, sometimes a block will be filled with long-lived data that does not get over-written. In this case, garbage collection will never reclaim the block, and thus it does not receive its fair share of the write load.
To remedy this problem, the FTL must periodically read all the live data out of such blocks and re-write it elsewhere, thus making the block available for writing again. This process of wear leveling increases the write amplification of the SSD, and thus decreases performance as extra I/O is required to ensure that all blocks wear at roughly the same rate.
Get hands-on with 1400+ tech skills courses.