عجفت الغور

hard drives

Tags: hardware

Spinning Rust

  • Operating systems implement all sorts of spinning rust scheduling, since they can make a good guess about how long operations will take (compared to jobs)
    • SSTF - shortest seek time first, but vulnerable to starvation due to a stream of nearby jobs
    • SCAN - loops back and forth, enqueueing for the next scan
    • SPTF - Shortest access first
  • Disks can also merge IOs together

NVMe

Writes and Reads

  • NVMe writes and reads are done through two circular buffers, a submission queue and a completion queue.
  • When the host system has a command to send to the SSD, it places the command in the submission queue and then rings the doorbell. This updates the tailpointer of the queue
  • Similar thing happens for completion queues, the drive updates the head doorbell when something is done

VS SATA and SCSI

Links to this note