IAE Academy

GATE 2018 CS Q.53: solution and answer

GATE 2018 · CSQ.53 · 2 marks · NAT

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 ______.

See the question in the paper

Answer and solution

ANSWER

The total power consumption is 85 mW.

Official answer: 85Source: Official answer key, GATE 2018 CS (IIT Guwahati)

  1. Only the cylinder numbers matter, because rotational latency and platter switching cost no power. The requested cylinders are . The head starts at cylinder 80 and is moving towards higher cylinder numbers.

  2. SSTF always serves the pending request whose cylinder is closest to the current head position.

  3. Why each choice: at 80 the candidates are 86 (distance 6) and 72 (distance 8). At 86 the candidates are 72 (14) and 116 (30). At 72 the candidates are 116 (44), 20 (52) and 134 (62). At 116 the candidates are 134 (18) and 20 (96). At 134 the candidates are 20 (114) and 16 (118). At 20 only 16 remains.

  4. The head starts moving up and the first move (80 to 86) is also up, so it is not a reversal. Total head movement cylinders. Movement power mW.

  5. The direction changes up to down at 86, down to up at 72, and up to down at 134, so the head reverses 3 times. Reversal power mW.

  6. Total power mW.

KEY IDEA

Run SSTF on cylinder numbers alone. Total power is (total cylinders moved / 100) x 20 mW plus 15 mW for each change of direction. Count a reversal only when the direction actually flips, and the initial heading is part of the state.

WATCH OUT FOR

Counting the first move as a reversal, or forgetting the reversals at 86, 72 and 134. Another slip is using sector or platter numbers when picking the nearest request, or treating the 20 mW as a cost per cylinder instead of per 100 cylinders.

From the GATE 2018 CS paper. Every question of this paper · Download the full paper · All 6 File systems & disks questions, with notes

More File systems & disks questions