Sub topic 10
SSDs and Why Seek-Based Scheduling Matters Less
This chapter assumes you know how a magnetic disk is organized, how access time splits into seek, rotational latency and transfer time, and how SCAN-family algorithms reduce head movement. It builds on the access-time chapter. It explains why most of that machinery stops mattering on a solid-state drive (SSD), and which parts still do.
What an SSD is
An SSD stores data in NAND flash memory chips. It has no platters, no head and no spinning. A controller inside the drive translates read and write requests from the operating system into operations on the flash chips.
Flash is organized differently from a disk:
- A page (typically 4 KB to 16 KB) is the smallest unit you can read or program (write).
- A block (also called an erase block) is a group of pages, often 128 to 512 pages. It is the smallest unit you can erase.
- A page that has been written cannot be overwritten in place. The whole block that contains it must be erased first.
Because the cost to reach any page is nearly the same, the two terms that dominated disk access time disappear:
| Component | Magnetic disk | SSD |
|---|---|---|
| Seek time | Several ms, depends on distance | None |
| Rotational latency | Up to one rotation, average half | None |
| Transfer time | Depends on rotation speed | Depends on flash and interface |
| Typical random 4 KB read | About 10 ms | About 0.05 to 0.15 ms |
Why cylinder-distance algorithms lose their point
SSTF, SCAN, C-SCAN, LOOK and C-LOOK all minimize the distance the head travels. On an SSD, the distance between two logical block addresses has no physical meaning. Reading block 10 and then block 1,000,000 costs about the same as reading block 10 and then block 11.
Total head movement, the quantity you compute in GATE questions, is therefore not a useful performance measure for an SSD. The problem types in this tutorial still apply to hard disks, and GATE asks about them. The point of this chapter is the contrast.
What still matters on an SSD
Removing seek time does not remove all scheduling concerns.
Read and write asymmetry
A page read takes tens of microseconds. A page program takes a few hundred microseconds. A block erase takes a few milliseconds. A request that triggers an erase can be 10 to 100 times slower than a read, so the order of reads and writes still affects latency.
The flash translation layer
Since pages cannot be overwritten, the controller runs a flash translation layer (FTL). The FTL keeps a table mapping logical block addresses to physical pages. When the OS rewrites a logical block, the FTL writes the new data to a free page and marks the old page invalid. A background process called garbage collection later copies the still-valid pages out of a block and erases it.
Garbage collection causes write amplification: the flash receives more writes than the host sent. Write amplification is the ratio of bytes written to flash to bytes written by the host.
def write_amplification(host_bytes, flash_bytes):
return flash_bytes / host_bytes
# The host writes 1 GB. Garbage collection copies 0.5 GB of valid pages first.
print(write_amplification(1.0, 1.5)) # 1.5Wear leveling
Each flash block survives a limited number of program/erase cycles. The FTL spreads writes across blocks, which is called wear leveling, so no block wears out early. Repeated overwrites of one logical block therefore land on different physical pages.
Parallelism and queue depth
An SSD contains many flash chips, usually reached through several channels. It can work on several requests at once. To exploit this, the OS must keep many requests outstanding. Modern interfaces such as NVMe support tens of thousands of queued commands, compared with 32 for SATA's native command queuing. A scheduler that serves one request at a time leaves most of the drive idle.
The TRIM command
When a file is deleted, the file system knows those blocks are free, but the SSD does not. The TRIM command tells the drive which logical blocks are no longer in use. Garbage collection can then skip copying them, which lowers write amplification. This links the SSD to the free-space management chapter.
What operating systems do in practice
Linux offers I/O schedulers with different goals. For SSDs, a simple policy is usually chosen:
- none (or noop): pass requests through in arrival order, essentially FCFS. The drive's own controller handles parallelism.
- mq-deadline: gives each request a deadline so no request waits too long, and favors reads over writes.
- BFQ: shares bandwidth fairly among processes, useful when responsiveness matters.
Schedulers still merge adjacent requests into larger ones. Merging reduces per-request overhead on any device. SSTF-style reordering is dropped, because it costs CPU time and buys nothing.
Sequential versus random access on an SSD
The gap between sequential and random access shrinks on an SSD but does not vanish. Larger requests use more channels in parallel, and small random requests carry per-command overhead. Defragmenting a file system, which helps a hard disk by making files contiguous, gives an SSD almost no benefit and adds wear.
Common errors
- Applying head-movement formulas to an SSD. They have no meaning there.
- Concluding that SSD scheduling is irrelevant. Fairness, deadlines and queue depth still matter.
- Saying SSDs can overwrite data in place. They cannot, which is why the FTL exists.
- Mixing up the program unit (page) with the erase unit (block).
- Treating SSD capacity as unlimited writes. Endurance is finite.
Worked comparison
A disk has a 9 ms average seek, spins at 7200 rpm, and reads 8 sectors from a 400-sector track. The earlier chapter's formula gives about 13.33 ms. An SSD serving the same 4 KB read takes roughly 0.1 ms. A queue of eight random requests costs about 107 ms on the disk if served one at a time. SSTF or SCAN might trim the seek portion, but the rotational and transfer terms stay. On the SSD, the same eight requests can overlap across channels and finish in well under 1 ms of total time.
Exercise
A student says: "SCAN is better than FCFS on our SSD because it reduces total head movement." Give two reasons this reasoning is wrong.
Show answer
First, an SSD has no head, so total head movement is not defined and does not affect latency. Second, the cost of an access on an SSD does not depend on the distance between logical block addresses. SCAN adds sorting work and can delay requests unfairly, with no benefit. What still matters on an SSD is queue depth, read/write mix and garbage collection.
Exercise
An SSD has 256 pages per erase block. A block holds 200 valid pages and 56 invalid pages when garbage collection selects it. How many pages does the controller copy and erase, and what is the write amplification if the host wrote only the 56 replacement pages that made the old ones invalid?
Show answer
The controller copies the 200 valid pages to a new block, then erases the old block. The flash writes 56 new pages from the host plus 200 copied pages, which is 256 page writes for 56 host writes. Write amplification is 256 / 56, about 4.57.