GATE 2018 CS – Question 63
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
Head starts at cylinder 80 moving towards higher cylinders. Request cylinders: 72, 134, 20, 86, 116, 16.
**SSTF order** (always the closest unserved cylinder):
| From | Candidates (distance) | Served |
|---|---|---|
| 80 | 86 (6), 72 (8) | 86 |
| 86 | 72 (14), 116 (30) | 72 |
| 72 | 116 (44), 20 (52) | 116 |
| 116 | 134 (18), 20 (96) | 134 |
| 134 | 20 (114), 16 (118) | 20 |
| 20 | 16 (4) | 16 |
**Head movement:** $6+14+44+18+114+4=200$ cylinders. At 20 mW per 100 cylinders: $\frac{200}{100}\times20=40$ mW.
**Direction reversals:** 80→86 is up, 86→72 is down (reversal 1), 72→116 is up (reversal 2), 116→134 up, 134→20 down (reversal 3), 20→16 down. That is 3 reversals $\times15=45$ mW.
$$\text{Total}=40+45=\mathbf{85}\text{ mW}.$$