1. The Importance of Wear Leveling

The purpose of wear leveling is to prevent some blocks from going bad too early, thereby reducing reliability. It tries to distribute erase operations as evenly as possible across different blocks so that they all reach the end of their lifespan at roughly the same time.

Flash storage is normally managed through a file system, and the file system has a hard requirement on the capacity of the underlying storage medium. For example, a 4 GB file system, plus some file metadata, may require the storage medium to have a capacity close to 4.1 GB. If some cells in your SSD happen to fail prematurely, the SSD may no longer have enough capacity, and the file system will be corrupted and unable to provide normal read/write service.

For instance, suppose your flash device has 4096 blocks, and the file system is made small enough that tolerating 2.5% bad blocks still satisfies the capacity requirement. You have 3 files, each occupying 50 blocks, updated every ten minutes. If your wear leveling is poorly implemented and erase operations stay confined to only 200 blocks, then after one year those 200 blocks may all have failed. At that point 5% of your usable storage space is gone. Although the remaining blocks have never been used, your file system can no longer function correctly.

2. Basic Approaches to Wear Leveling

Wear leveling is typically implemented on the SSD controller. The block addresses sent by the CPU are called logical block addresses (LBA, logical block address), and the SSD controller maintains a block translation table that maps logical block addresses to physical block addresses (PBA, physical block address).

2.1 Dynamic Wear Leveling and Static Wear Leveling

The data in a system is divided into static data and dynamic data, also known as cold data and hot data. For example, an operating system image is typically written once and then never modified; this kind of data is static data (cold data). A Word document, on the other hand, may be edited continuously, making it dynamic data (hot data).

Dynamic wear leveling only performs wear leveling on dynamic data. The main idea is that when the controller receives a new write request and needs to erase a block, it preferentially chooses a flash block with no data that is “newer (lowest erase count)” for the erase and write operation, leaving static data untouched.

The advantage of this approach is that the algorithm is simple and direct, the controller bears less processing load, and the resource overhead is small. The disadvantage, however, is obvious: the algorithm is too one-size-fits-all and lacks fine-grained optimization, so it cannot fully cover and achieve wear leveling across every cell.

Static wear leveling requires judging whether data is “hot or cold”. When the controller executes an erase-and-write command, it looks at things from the file’s perspective: it preferentially moves long-unused cold data out of newer flash cells into older flash cells, and places newly written data into the newer flash cells, so as to achieve a balanced distribution.

The advantage of this approach is also clear: the algorithm is more optimized, achieves more comprehensive wear leveling from the perspective of the data itself, and extends cell lifetime. The drawback is the algorithm’s complexity, which places considerable load on the controller. Because writing new data may involve relocating cold data, it increases write latency, consumes more read/write resources, and affects part of the write throughput.

2.2 Static Wear Leveling and “Big Wisdom”

Wear leveling methods studied in the industry are usually dynamic wear leveling. There are many different dynamic wear leveling methods, and new ones continue to be proposed.

Traditional wear leveling is built into the SSD controller, and its wear leveling algorithm maintains an even wear distribution across the SSD’s internal storage space.

Some Internet companies, however, hope to take wear leveling to the data-center level. They divide hot/cold data at the granularity of data shards, enabling better static wear leveling. They call this approach “big wisdom”.

Wear leveling methods studied in the industry are usually dynamic wear leveling. There are many different dynamic wear leveling methods, and new ones continue to be proposed.

3. References

1. Wear-Leveling Techniques in NAND Flash Devices

Last modified: 2026年7月13日

Author

Comments

Write a Reply or Comment

Your email address will not be published.