I/O scheduling
Disk-scheduling numericals are path problems before they are timing problems. Write the service order, include the movements required by the selected policy, and then apply the given seek-time model. Mechanical timing below supplies the context needed for I/O scheduling.
7.1 Device service and access time
Past papers · CS 2014–2026 (23 papers): 2 questions, 4 marks
A blocking I/O caller can sleep while other processes execute. For polling, interrupt and DMA interface costs, see the Computer Organization and Architecture handbook.
Sequential transfers need not pay a full seek and half revolution for every block. For a request spanning tracks, use the stated track-switch and layout assumptions. SSDs have no mechanical seek or rotational wait; the head-movement algorithms below model moving-head disks.
7.2 Service order and head movement
Past papers · CS 2014–2026 (23 papers): 5 questions, 9 marks
| Policy | Next request / turnaround rule |
|---|---|
| FCFS | Service in arrival order |
| SSTF | Select the request closest to the current head; break ties as stated |
| SCAN | Service along one direction, reach the disk endpoint, then reverse |
| LOOK | Reverse at the furthest outstanding request in that direction |
| C-SCAN | Service one direction; reach endpoint, return to the opposite endpoint without servicing on return |
| C-LOOK | Service one direction; return from the furthest request to the nearest request at the other end |
SSTF may starve distant requests when new nearby requests continue to arrive. For a finite queue, stop the movement count when the last required request is served unless the question explicitly asks for a complete sweep.
7.3 A complete path comparison
SCAN includes the endpoint before reversing; LOOK reverses at the last request.
Last-minute recall
- Sort a snapshot of requests only when the policy permits it.
- SSTF re-evaluates distance after each service.
- State direction before drawing a sweep.
- Include endpoint and return movements when required.
- Cylinder distance and seek time are not interchangeable without a model.
- Queueing delay is additional to device service time.