In the past decade, academia and industry contributed many wear-leveling algorithms. Table 1 summarizes some representative approaches. These algorithms can generally be divided into two categories: Placement-based algorithms and reclaiming-based algorithms. Let a block having a (relatively) large erasure cycle and a block having a small erasure cycle be referred
Δ: The maximum difference between any two block-erasure cycles Algorithm
Name Block-Allocatio
n Policy Triggering
Condition Wear-leveling Policy Reference
(HC) Hot-Cold
Swapping FIFO Periodically If Δ becomes larger than a predefined threshold, data stored in the oldest block and in the youngest block are swapped.
Two-Level Youngest block
first Periodically First level: To always allocate the youngest block for new writes.
Second level: If Δ becomes larger than a predefined threshold, then move all live data away from the youngest block
STMicroeleconics [25], Chang et al. [8]
(EP) Erase
Pool FIFO On each write Blocks of free space are organized as an erase pool, and newly written data are dispatched to free space allocated from blocks in the pool. How blocks are organized in the erase pool is undefined.
FIFO is assumed in this paper.
SmartMedia[15],
If the difference between the erasure cycles of the just-erased block and the youngest block is larger than a predefined threshold, data in the youngest block are moved to the erased block.
If a just-erased block is involved in wear leveling, it won’t be involved again until a predefined number of block erasures have been performed to other blocks.
UBI [22]
(KL) Kim and
Lee Youngest block
first On garbage
collection Erase the block having the largest score for garbage collection according to Equation (2) Kim and Lee [7]
(CAT) Cost-Age- Time
Youngest block
first On garbage
collection Erase the block having the largest score for garbage collection according to Equation (1) Chiang et al. [20]
(TB) Turn-Based
Selection FIFO Periodically In x out of x+y times, garbage collection selects a block for erasure in favor of efficient garbage collection. In the rest y times, a block is chosen for erasure according to some wear-leveling rules. In [7], a block of all live data is chosen, and in [8] a block is randomly selected for erasure2.
JFFS2 [13],
Cold-data migration: use the migration of cold data to cease the wearing of overly worn blocks.
Hot-cold regulation: blocks are shielded from wear-leveling activities to see how the wearing of
blocks introduced by cold-data migration develops. This paper
Table 1: A summary of wear-leveling algorithms considered in this paper.
to as an old block and a young block, respectively. The explanations of the algorithms are as follows:
Placement-based algorithms accomplish wear leveling by means of to timely change data placement. Most of the algorithms are orthogonal to garbage collection. That is, they passively react to the wearing of blocks developed by garbage collection. Hot-cold swapping (algorithm HC) is proposed by M-System [30], Chang et al. [15], and Kim et al. [9]. It periodically swaps the data in the oldest block and in the youngest block. The idea is to “reverse” the wearing of such two kinds of blocks. Besides of swapping, blocks that have free space are organized in an FIFO queue. Newly written data are dispatched to the queue-head block, and newly erased blocks are appended to the queue. It is to fairly wear blocks. A different approach, algorithm 2L, tries to periodically “defrost” young blocks by moving all its data away. The approach is used by STMicroelectronics [38] and Chang et al. [13]. Bityutskiy et al. [21] (algorithm OP) proposed to check the youngest block and the block that has just been erased. If the latter block is old enough, then data in the youngest block are moved to the old block. The old block is then protected against being involved in wear leveling again until a number of block-erasure operations to any other blocks have been completed.
Reclaiming-based algorithms refer to garbage-collection policies that also take wear leveling into consideration. Turn-based selection (algorithm TB) is a commonly adopted technique
in the open-source community: In x out of x + y times, block erasure is handled in favor of efficient garbage collection. For the rest y times, block erasure is guided by some wear-leveling rules. In particular, JFFS2 [5] chooses a block of all live pages, and YAFFS [23]
randomly picks a block for erasure 2. The two approaches aim at providing young blocks some chances to get erased. Rather than to periodically switch between garbage collection and wear leveling, some algorithms choose to adaptively change their preferences by means of using a score function for blocks. The block of the largest score is always chosen for erasure.
The score function proposed by Chiang et al. [17] (algorithm CAT) is
score(i) = µi· ai(t)
(1 − µi) · ²i (1)
, in which µi, ai(t), ²i denote space utilization, an aging function, and the erasure cycle of block i, respectively. Function ai(t) monotonically increases with t the time duration that how long block i has not been erased. The score function proposed by Kim and Lee [9] (algorithm KL) is
score(i) = (1 − l) · µi+ l · ²i
²max+ 1 , l =
2 1+e∆²k²
if ∆²6= 0
0 , otherwise (2)
, in which ²max is the maximum erasure cycle of all blocks, and ∆² is the maximum difference between any two block-erasure cycles. Algorithm KL is configurable: the smaller k² is, the more aggressive it would be for wear leveling. When the wearing of blocks becomes uneven, algorithm CAT and algorithm KL would prefer to erase blocks of small erasure cycles. They prefer efficient garbage collection when blocks are evenly worn.
Some algorithms do not explicitly conduct wear-leveling activities. In particular, approaches adopted by Sandisk [37] and SSFDC forum [36] simply rely on out-place update for “wear leveling”. However, this approach can not prevent cold data from being anchored in some particular blocks.
To our best knowledge, there is not yet related work on how wear-leveling algorithms can be implemented in resource-restrictive SSD controllers. In [15], it has been reported that
2Differences exist among revisions. The description is conceptual. YAFFS’s wear-leveling algorithm is
Figure 4: The SSD evaluation board.
algorithm KL and algorithm CAT are too computation-intensive to be used in processors with weak computing power. All the other algorithms would require RAM space that can be afforded by SSD controllers.