I 10 Wear Leveling
This page is a generated reference surface for selective reading. It exists to keep the learner apps guide-first while still preserving source access.
Learning objectives
- Explain the main ideas and vocabulary in I 10 Wear Leveling.
- Work through the source examples for I 10 Wear Leveling without depending on raw chunk order.
- Use I 10 Wear Leveling as selective reference when learner modules point back to Ostep.
Prerequisites
- None curated yet.
Module targets
module-04-file-systems-io
AI companion modes
- Explain simply
- Socratic tutor
- Quiz me
- Challenge my understanding
- Diagnose my confusion
- Generate extra practice
- Revision mode
- Connect forward / backward
Source-of-truth note
This unit is anchored to Ostep and the source chapter "I 10 Wear Leveling". Use external resources only to clarify, extend, or modernize details without replacing the chapter's conceptual spine.
External enrichment
No chapter-specific enrichment resources are curated yet. Add them in the unit manifest when a source clearly improves learning.
Source provenance
- Primary source:
Ostep - Source chapter: I 10 Wear Leveling
- Raw source file:
273-i-10-wear-leveling.md
Merged source
I 10 Wear Leveling
I.10 Wear Leveling
Finally, a related background activity that modern FTLs must implement iswear leveling, as introduced above. 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 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.
Many different algorithms exist in the literature [A+08, M+14]; read more if you are interested.
I.11 SSD Performance And Cost
Before closing, let's examine the performance and cost of modern SSDs, to better understand how they will likely be used in persistent storage systems. In both cases, we'll compare to classic hard-disk drives (HDDs), and highlight the biggest differences between the two.
Performance
Unlike hard disk drives, flash-based SSDs have no mechanical components, and in fact are in many ways more similar to DRAM, in that they are "random access" devices. The biggest difference in performance, as compared to disk drives, is realized when performing random reads and writes; while a typical disk drive can only perform a few hundred random I/Os per second, SSDs can do much better. Here, we use some data from modern SSDs to see just how much better SSDs perform; we're particularly interested in how well the FTLs hide the performance issues of the raw chips.
Table I.4 shows some performance data for three different SSDs and one top-of-the-line hard drive; the data was taken from a few different online sources [S13, T15]. The left two columns show random I/O performance, and the right two columns sequential; the first three rows show data for three different SSDs (from Samsung, Seagate, and Intel), and the last row shows performance for ahard disk drive(orHDD), in this case a Seagate high-end drive.
Random Sequential
Reads Writes Reads Writes
Device (MB/s) (MB/s) (MB/s) (MB/s)
Samsung 840 Pro SSD 103 287 421 384
Seagate 600 SSD 84 252 424 374
Intel SSD 335 SSD 39 222 344 354
Seagate Savvio 15K.3 HDD 2 2 223 223