8.2Disk scheduling algorithms
The idea
Disk scheduling orders pending requests to reduce head movement: FCFS, SSTF, SCAN, LOOK, C-SCAN, C-LOOK.
Think of it like this: An elevator: it serves all floors on the way up, then all on the way down, instead of jumping around.
Why it exists
Seek time dominates, so a good order saves a great deal of waiting.
How it works
- FCFS: arrival order.
- SSTF: nearest cylinder next (may starve far requests).
- SCAN: sweep to the end in one direction, reverse; LOOK turns at the last request.
- C-SCAN / C-LOOK: sweep one way, jump back, sweep again. Sum the cylinder differences for the total.
Worked example: Head at 53, queue 98 183 37 122 14 124 65 67
FCFS 640 cylinders, SSTF 236, SCAN (up, disk end 199) 331, LOOK 299.
Now play with it
- →Switch the algorithm and compare totals.
- →Reverse the initial direction and see SCAN change.
SCAN and C-SCAN go all the way to the disk end; LOOK and C-LOOK turn at the last request. C-SCAN and C-LOOK serve in one direction only and jump back (many exams count that jump, some do not, so read the question). SSTF can starve far requests.
Check yourself
Which algorithm can starve a request far from the head?
Exam notes (the dense version)
FCFS: serve in arrival order, fair but long movement. SSTF: nearest request next, good throughput but can starve far requests. SCAN (elevator): sweep in one direction to the disk end, then reverse. LOOK: like SCAN but turn around at the last request. C-SCAN / C-LOOK: serve in one direction only, then jump back to the start; gives more uniform waiting time. Total head movement is the sum of |difference| between consecutive cylinders; read the question for whether the return jump counts.
Previous year questions: Disk Scheduling & I/O (12)
PYQs are grouped by topic, so this is the full set for Disk Scheduling & I/O; try the ones that match this subtopic. Open all 12 on the topic page.