SSD

Eunji·2025년 6월 11일

Operating System

목록 보기
10/11

Beyond Spinning Disks

Pros

  • Cheapest way to store large amounts of data

Cons

  • Slowest component in most computers
  • Fragile mechanical components can break
  • Disk motor is extremely power hungry

Solid State Drives

NAND flash memory-based drives

  • NOR: random access in Byte unit
    • HDD
  • NAND: Access in Block, Page unit
    • ROM
    • Non-volatile memory

Props

  • More resilient against physical damage
    • Disk가 없기 때문에 head를 읽거나 움직일 필요 x
  • Reduced power consumption
    • No mechanical parts
  • Much faster than hard drives
    • No penalty for random access
      • Each flash cell can be addressed directly
      • No need to rotate or seek
    • Extremely high throughput
      • Although each flash chip is slow, they are RAIDed

Challenges with Flash

Flash memory is written in pages, but erased in blocks

  • Pages: 4-16KB, Blocks: 128-256KB
  • Thus, flash memory can become fragmented (in block) -> Write amplication

Flash memory can only be written a fixed number of times

  • Typically 3000 – 5000 cycles for MLC
  • SSDs use wear leveling to evenly distribute writes across all flash cells

지울 때 저항이 발생하기 때문에 횟수 정해짐 -> 수준 맞추기


Write Amplification

  • Once all pages have been written, valid pages must be consolidated
  • A write triggers garbage collection / compaction
    • One or more blocks must be read, erased and rewritten before the write can proceed

Garbage Collection

  • Vital for the performance of SSDs
  • Many SSDs over-provision to help the GC
    • 240 GB SSDs actually have 256 GB
    • GC uses 16 GB
    • If use the all 240 GB, write on 16 GB and move later

The Ambiguity of Delete

  • Goal : SSD wants to perform background GC
  • Problem: most file systems don’t actually delete data
    • On linux, delete function is unlink() -> delete 표시만

Metadata is overwritten, but the file remains

  1. File is written to SSD
  2. File is deleted
  3. GC executes
    • 9 pages look valid to the SSD

  • Lack of explicit delete means the GC wastes effort copying useless pages (7 Files)
  • Hard drives are not GCed, so this was never a problem

TRIM

  • New SATA command TRIM
  • Allow the OS to tell the SSD that specific LBAs are invalid
  • Delete function makes files invalid

Wear Leveling

  • each flash cell wears out after several thousand writes
  • SSDs use wear leveling to spread writes across all cells
    -> 메모리 셀들의 마모를 균등하게 분산

Dynamic Wear Leveling

  • Wait as long as possible before garbage collecting
  • Blocks with pages that are not updated will not be rewritten
    • 업데이트 안 되는 블럭은 계속 쓰이지 않음

Static Wear Leveling

  • Blocks with long lived data receive less wear
  • SSD controller periodically swap long lived data to different blocks
    • block write 균형 맞춤


SSD Controllers

  • SSDs are extremely complicated internally
  • All operations handled by the SSD controller
    • Maps LBA to physical page
    • Keeps track of free pages, controls the GC
    • May implement background GC
    • Performs wear leveling

Flavors of NAND Flash Memory

Multi Level Cell

Consumer-grade drives

  • Multiple bits per flash cell
  • Higher capacity and cheaper than SLC flash
  • Lower throughput due to the need for error correction(overhead)
  • 3000-5000 write cycles
  • Consumes more power

Single Level Cell

Expensive, enterprise drives

  • One bit per flash cell
  • Lower capacity and more expensive than MLC
  • Higher throughput than MLC
  • 10000 - 100000 write cycles

0개의 댓글