CS 134

Key Points: Flash Storage and SSDs

Flash Memory Fundamentals

  1. Physical Structure:
    • Flash cells are transistors with floating gates that trap electrons
    • Pages are the smallest writable units (typically 4–8 KB)
    • Blocks contain multiple pages (typically 64–256 pages)
    • Different cell types (SLC/MLC/TLC/QLC) store different numbers of bits
  2. Basic Constraints:
    • Pages must be erased before rewriting
    • Can only erase entire blocks, not individual pages
    • High-voltage erase operations gradually damage cells
    • Limited number of erase cycles per block
  3. Cell Types and Endurance:
    • SLC (1 bit): ~100,000 erase cycles
    • MLC (2 bits): ~10,000 erase cycles
    • TLC (3 bits): ~3,000 erase cycles
    • QLC (4 bits): ~1,000 erase cycles
    • More bits per cell means higher density but lower endurance

Flash Translation Layer (FTL)

  1. Basic Functions:
    • Maps logical addresses to physical locations
    • Handles wear leveling
    • Manages garbage collection
    • Tracks block health and wear
  2. Key Concepts:
    • Write amplification: when one logical write causes multiple physical writes
    • Overprovisioning: reserving space for management
    • Trim: marking pages as no longer needed
    • Garbage collection: reclaiming space from invalid pages
  3. Management Strategies:
    • Block-level remapping
    • Page-level remapping within blocks
    • Random remapping to prevent targeted wear
    • More sophisticated strategies for better performance and endurance
      • Pedagogical example: LBA permutation for wear distribution
      • Real-world: hybrid FTLs with DRAM caches and other optimizations

Operating System Considerations for SSDs

  1. Best Practices:
    • Use trim to mark unused pages
    • Utilize native command queuing
    • Align writes with page boundaries
    • Minimize update-in-place operations
    • Avoid excessive swapping to SSD
  2. Performance Factors:
    • Available free space affects write amplification
    • Command queuing allows better scheduling
    • Block alignment can significantly impact performance
  3. Reliability Considerations:
    • Maintain sufficient free space
    • Regular TRIM operations
    • Monitor drive health
    • Consider workload patterns

Other Block Devices

  1. RAID:
    • Combines multiple drives for performance and reliability
    • Various levels (0, 1, 5, 6, 10, etc.) balance trade-offs
    • Software RAID can be more flexible but slower
  2. Network Block Devices:
    • Allow remote block storage over a network
    • Used in cloud storage, virtualization, and other scenarios
    • Must consider latency, reliability, and security

Remember

  • Flash memory's write/erase asymmetry fundamentally affects SSD design
  • The FTL provides the illusion of a simple block device despite complex physical constraints
  • Different SSD designs balance capacity, performance, and endurance
  • Operating systems must work with SSDs differently than with traditional disks
  • Modern SSDs are quite resilient when properly managed
  • Overprovisioning and sophisticated FTLs are key to SSD longevity

(When logged in, completion status appears here.)