Static wear leveling
Static wear leveling relocates infrequently updated data so that lightly worn occupied flash blocks can return to the write-allocation pool.
In the pinned Linux UBI implementation, ordinary wear-leveling work selects a lightly worn used eraseblock and a more-worn free destination; their erase-counter difference must be at least the configured threshold. Bit-flip-triggered scrubbing follows a separate branch. The condition is not a continuously enforced global wear-spread bound. [1]
CONFIG_MTD_UBI_WL_THRESHOLD defaults to 4096 in that revision's build configuration. It is not a universal static-policy threshold or a managed-SSD setting. [6]
A worked example of dynamic leveling has rarely updated code occupying 25% of capacity and frequently updated data using the remaining 75%. Static leveling copies cold code into more-worn free blocks, releasing less-worn source blocks for reuse. The destination still needs retention margin; a block near wear-out can be unsuitable for persistent code. [2]
Relocation adds flash writes, and cold here describes update frequency, not temperature. In a simulated drive with 1 MiB blocks and 11% over-provisioning under a skewed workload, one aggressive static policy reached an overall write amplification factor of 11.49, including garbage collection; section 2.2 attributes 5.4 to wear leveling. These are different counters, not two estimates of the same quantity. [3] OBP, DP and PWL are static policies evaluated in a 2025 extension of that work, which excludes dynamic wear leveling, so it cannot establish that every dynamic policy has the same tradeoffs. [5]
Relations
- related
- Wear leveling, Dynamic wear leveling, Flash translation layer (FTL), Flash data retention, Write amplification, Hot/cold data separation, Effective spare factor, Over-provisioning, Greedy garbage collection
Advantages
- Drawing on the endurance left in blocks that hold rarely rewritten data extends the apparent wear life of the device. [2]
Limitations
- The pinned UBI configuration's 4096 default and lower 128/256 examples are implementation-specific guidance, not endurance ratings or universal tuning advice. [6]
Citations
- Linux UBI wl.c at c7decec2f2d2ab0366567f9e30c0e1418cece43f: subsystem overview and wear_leveling_worker candidate-selection branches.
- Macronix. Wear Leveling in NAND Flash Memory. AN0289, revision 1, March 10, 2014, p. 2.
- Jiao, Bhimani and Kim. Wear Leveling in SSDs Considered Harmful. HotStorage 2022, sections 1-2. DOI 10.1145/3538643.3539750.
- Jiao and Yang. Wear Leveling in SSDs Considered Harmful: A Case for Capacity Variance. Electronics 14, 4169 (2025), sections 3-5.
- Linux UBI Kconfig: MTD_UBI_WL_THRESHOLD default and guidance (pinned source revision).
Further reading
Sources & caveats
- ubi re-read 2026-10-23 at the pinned revision for low-to-high erase-counter moves and scrubbing.
- ubi-kconfig read 2026-10-23 at the same revision for the 4096 default and the 128 or 256 suggestion.
- macronix re-read 2026-10-23 for the 25%/75% code and data example and the retention caution.
- jiao re-read 2026-10-23 for the 1 MiB block, 11% over-provisioning setup and the 11.49 factor.
- The greedy-garbage-collection entry links here because the cited wear-leveling simulation runs its static policies on top of greedy block cleaning.
- A companion analysis on wear-leveling foundations is listed but not used in prose.
- 2026-11-05: checked UBI candidate selection and the less-than rejection test, not the worker's reversed-direction comment. Equality meets this condition; other eligibility and failure paths remain. Source inspection only, not a UBI runtime experiment.