Process Management · Lab

Disk Scheduling Algorithms

The disk arm can only serve one cylinder at a time. Compare FCFS, SSTF, SCAN and C-SCAN by watching the head move and measuring total seek distance.

Why disk scheduling matters

Disk scheduling is the operating system’s policy for ordering pending I/O requests. A good order reduces head movement, which reduces seek time and improves responsiveness for processes waiting on storage.

Seek time — The time or distance required for the disk head to move to a requested cylinder.
Request queue — The set of pending cylinder requests waiting for the disk device.
SSTF — Shortest Seek Time First chooses the pending request closest to the current head position.
SCAN — The elevator algorithm moves in one direction, serving requests, then reverses at the disk boundary.

Real-world analogy: An elevator in a tall building

FCFS visits floors in arrival order. SSTF serves the closest floor. SCAN keeps moving upward, then returns downward like an elevator, while C-SCAN returns to the first floor without serving during the wrap.
Experiment: Seek-time simulator

Cylinder numbers separated by commas or spaces.

Head movement map

Complete seek path

Cylinder position across · move order down

050100149199Start5301R1 · 9802R2 · 18303R3 · 3704R4 · 12205R5 · 1406R6 · 12407R7 · 6508R8 · 67
Current head: 53Visited path Upcoming path
Ready — press Next step

Seek trace

Ready to begin

0 of 8 requests serviced

The head starts at cylinder 53. Advance one step to see which request the selected policy handles next.

Serviced order

—

Seek distance so far

0 tracks

Average seek per request

—

StepMoveFrom → ToSeekReason
Algorithm decision guide

FCFS · simplest baseline

Honours arrival order and is fair, but can create large, unnecessary head movements.

SSTF · shortest immediate move

Often lowers seek distance, but distant requests may wait when nearby requests keep arriving.

SCAN · elevator sweep

Provides predictable service by sweeping across the disk and reversing at an edge.

C-SCAN · one-way sweep

Services requests in one direction, then wraps to the other edge for more uniform waiting time.

Quick quiz

1. Which algorithm always preserves the request arrival order?

2. SSTF selects the request with…

Back to CPU scheduling