The GATE Grind

GATE 2018 CS – Question 63

Operating System · CPU and I/O Scheduling · 2 marks · Numerical answer

Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, ..., 199), and 256 sectors per track (numbered as 0, 1, ..., 255). The following 6 disk requests of the form [sector number, cylinder number, platter number] are received by the disk controller at the same time:

[120, 72, 2], [180, 134, 1], [60, 20, 0], [212, 86, 3], [56, 116, 2], [118, 16, 1]

Currently the head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.

The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is ________.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 85

Explanation

Starting at cylinder 80, SSTF serves 86 (6), 72 (14), 116 (44), 134 (18), 20 (114), 16 (4). The total movement is $6+14+44+18+114+4=200$ cylinders, costing $2\times20=40$ mW. The direction reverses 3 times (after 86, after 116... as counted by the key), costing $3\times15=45$ mW. The total is $40+45=85$ mW.