Β§44.10–44.12Wear Leveling, SSD Performance and Cost, and Summary

Part III OSTEP pp. 579–582 Β· ~4 min read

Two background jobs and a comparison remain.

44.10 Wear Leveling

Log-structuring and garbage collection already spread writes around, but there’s a gap: a block full of long-lived data that’s never overwritten is never garbage-collected β€” so it never gets its fair share of the write load, while other blocks wear out faster. So the FTL must occasionally do wear leveling proper: read the live data out of such a cold block and rewrite it elsewhere, freeing the block to take new writes. It costs extra I/O (more write amplification), but keeps all blocks aging at roughly the same rate.

44.11 SSD vs Hard Drive: Performance and Cost

Performance. With no moving parts, an SSD is essentially random-access. The dramatic difference is at random I/O:

Random-read bandwidth (MB/s)Samsung 840 Pro SSD103Seagate 600 SSD84Intel 335 SSD39Seagate 15K.3 HDD2the disk manages just 2 MB/s at random reads β€” SSDs are ~20–50Γ— faster
Figure 44.4: SSDs vs a high-end hard drive (MB/s). SSDs dominate at RANDOM I/O; the gap narrows for sequential.
random readrandom writeseq readseq write
Samsung 840 Pro (SSD)103287421384
Seagate 600 (SSD)84252424374
Intel 335 (SSD)39222344354
Seagate 15K.3 (HDD)22223223
Dotted-underlined cells have explanations β€” click one.

Two things stand out. Random I/O: SSDs do tens–hundreds of MB/s where the disk manages ~2 MB/s. Sequential I/O: the gap shrinks β€” a disk is still respectable if all you do is stream. And notice SSD random writes often beat random reads β€” a happy side effect of the log-structured FTL turning random writes into sequential ones.

Cost. So why haven’t SSDs killed disks? Cost per GB: an SSD runs ~60Β’/GB versus ~5Β’/GB for a disk β€” still a ~10Γ— gap. So large systems mix them: a little SSD for hot, performance-critical data; lots of cheap disk for cold bulk data. While the price gap holds, disks aren’t going anywhere.

44.12 Summary

Flash-based SSDs are everywhere now. Building one means taming flash’s quirks β€” erase-before-program and wear-out β€” with a flash translation layer that is usually log-structured (the same idea as LFS), paying the costs of garbage collection (write amplification) and mapping-table size (hybrid mapping helps), plus wear leveling to make the whole device age evenly. In one table:

The SSD, from the bottom up β€” the whole chapter in one table.
conceptwhat it is
flashflash: pages & blocksread/program a page; ERASE a whole block first β€” and erase wipes the block; blocks wear out after many P/E cycles
ftlflash translation layerpresents a normal block device; maps logical blocks β†’ physical flash read/erase/program
loglog-structured FTLappend writes to free pages + a mapping table (the LFS idea in-device); turns random writes sequential, spreads wear
gcgarbage collectionreclaim dead pages left by overwrites (copy live out, erase block); adds write amplification, eased by trim + overprovisioning
mapmapping tableper-page is huge, per-block hurts small writes β†’ hybrid mapping (log + data tables) or caching hot mappings
wearwear levelingmigrate long-lived data off cold blocks so every block gets its share of P/E cycles
Dotted-underlined cells have explanations β€” click one.

This is just the first step β€” SSD design is a deep field, and the log-structured theme you’ve now seen at the file-system level (LFS) and the device level (the FTL) recurs throughout modern storage.

Check yourself: wear leveling, performance, and cost

1.Log-structuring and GC already spread writes. Why is explicit wear leveling still needed?

2.Where is the performance difference between SSDs and hard drives most dramatic?

3.Why do SSD random WRITES often outperform SSD random READS?

4.Given SSDs outperform disks even sequentially, why haven't they replaced hard drives?

5.Given the performance/cost trade-off, how are large storage systems often built?

6.What recurring design idea appears at BOTH the file-system level and the SSD device level?

6 questions