GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 53

SSTF movement and reversal costs

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

GATE 2018, Q53 2 marks · NAT
Report issue

I/O & Disk Scheduling

Question 53, GATE 2018: Disk has 4 platters, 200 cylinders and 256 sectors/track. Requests [sector,cylinder,platter]: [120,72,2],[180,134,1],[60,20,0],[212,86,3],[56,116,2],[118,16,1]. Head starts sector 100,cylinder 80 moving upward. SSTF movement costs are stated as 20 mW per 100 cylinders plus 15 mW per reversal; rotation/platter costs ignored. Find the intended total.
Tap to enlarge
Answer & solution

Official answer: 85

Our answer: 85 under the stated additive-cost convention

Step through it (8 steps)

Method

SSTF chooses nearest pending cylinder, not the next request in the current direction. At 80 choose 86 (6 away), then 72 (14 away). From 72, 116 is 44 away versus 20 at 52; then 134 is nearest. The remaining requests are 20 and 16. Direction is up, down, up, up, down, down, so there are three reversals relative to the initially upward head. Sector and platter numbers do not affect the stipulated cost model.

Solution

SSTF chooses cylinders 80→86→72→116→134→20→16, with distances 6, 14, 44, 18, 114, 4 totaling 200. The head starts upward and reverses at 86, 72, 134, three times. Treating the supplied numbers as additive movement costs gives(200/100)*20+3*15=85, the official answer. Physical power in milliwatts cannot in general be added over sequential operations to obtain total consumption; energy or a time-based average would require durations and appropriate units. Thus85 is the intended numerical cost, not a dimensionally justified physical power calculation.

Original paper, page 22 · Answer key