GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 20

Comparing FCFS and SSTF head travel

Operating Systems · I/O & Disk Scheduling · Full GATE CSE 1995 paper

GATE 1995, Q20 5 marks · Descriptive
Report issue

I/O & Disk Scheduling

Question 20, GATE 1995: A disk has tracks 0–99. Its head is at track 55, and the pending FIFO queue is 10,70,75,23,65. Calculate total head movement for FCFS and SSTF and say which is smaller.
Tap to enlarge
Answer & solution

Answer: FCFS:204 tracks. SSTF:85 tracks. SSTF saves 119 tracks. (no official key was published)

Step through it (2 schedules)

Head movement is the sum of absolute differences between consecutive serviced track numbers, including the initial position. FCFS must preserve arrival order: 55→10→70→75→23→65. Its successive movements are 45,60,5,52,42, totaling 204 tracks.

SSTF repeatedly chooses the nearest pending request from the current position, not the request nearest the original position. From55 the distances to 10,70,75,23,65 are 45,15,20,32,10, so choose 65. From65 choose 70 (distance 5), then 75 (distance 5). Of the remaining tracks 23 and 10, track 23 is 52 away and 10 is 65 away, so service 23 then 10. Thus the route is 55→65→70→75→23→10, and the total is 10+5+5+52+13=85. There are no distance ties in this instance.

SSTF therefore requires 119 fewer track movements, assuming seek effort is being compared by track distance. Neither algorithm requires a sweep to track 0 or 99; that would be a different scheduling policy. No return to the starting track is requested. The conclusion concerns this finite queue, not a claim that SSTF prevents starvation or always optimizes every possible workload.

Original paper, page 8