Skip to content
Official PYQ · 2001

GATE CS 2001 Q20 — I/O Scheduling

Explain with AI

Consider a disk with the 100100 tracks numbered from 00 to 9999 rotating at 30003000 rpm. The number of sectors per track is 100100 and the time to move the head between two successive tracks is 0.20.2 millisecond.

Choose one option
View worked solution

Answer: A

Here is the step-by-step solution for both parts of the question:

Part (A)

We are given:

  • Tracks: 00 to 9999
  • Initial head position: 2525, moving upwards
  • Requests: 32,7,45,5,1032, 7, 45, 5, 10
  • Seek time per track = 0.2 ms0.2\text{ ms}

Depending on the specific interpretation of the elevator algorithm, we analyze both standard variants:

  1. LOOK Algorithm (reverses at the last request):
    • The head moves from 25→32→4525 \to 32 \to 45, then reverses and moves 45→10→7→545 \to 10 \to 7 \to 5.
    • Total seek distance = (45−25)+(45−5)=20+40=60(45 - 25) + (45 - 5) = 20 + 40 = 60 tracks.
    • Total seek time = 60×0.2 ms=12 ms60 \times 0.2\text{ ms} = \mathbf{12\text{ ms}}.
  2. SCAN Algorithm (goes to the boundary):
    • The head moves from 25→32→45→9925 \to 32 \to 45 \to 99, then reverses and moves 99→10→7→599 \to 10 \to 7 \to 5.
    • Total seek distance = (99−25)+(99−5)=74+94=168(99 - 25) + (99 - 5) = 74 + 94 = 168 tracks.
    • Total seek time = 168×0.2 ms=33.6 ms168 \times 0.2\text{ ms} = \mathbf{33.6\text{ ms}}.

Part (B)

We are given:

  • Rotation speed = 3000 rpm=50 rotations/sec3000\text{ rpm} = 50\text{ rotations/sec}
  • Time for 11 full rotation = 150 s=20 ms\frac{1}{50}\text{ s} = 20\text{ ms}
  • Sectors per track = 100100
  • Transfer time for 11 sector = 20 ms100=0.2 ms\frac{20\text{ ms}}{100} = 0.2\text{ ms}

To find the worst-case time to complete 100100 arbitrary requests starting at track 00:

  • Worst-case distribution: Each of the 100100 requests lies on a different track (from track 00 to 9999).
  • Total Seek Time: The head traverses from track 00 to 9999 in a single sweep. Seek Time=99×0.2 ms=19.8 ms\text{Seek Time} = 99 \times 0.2\text{ ms} = 19.8\text{ ms}
  • Worst-case Rotational Latency: For each request, the head arrives just after the target sector has passed, requiring a full rotation (20 ms20\text{ ms}). Total Latency=100×20 ms=2000 ms\text{Total Latency} = 100 \times 20\text{ ms} = 2000\text{ ms}
  • Total Transfer Time: Reading 100100 sectors: Total Transfer Time=100×0.2 ms=20 ms\text{Total Transfer Time} = 100 \times 0.2\text{ ms} = 20\text{ ms}

Total Worst-Case Time=19.8 ms+2000 ms+20 ms=2039.8 ms≈2.04 seconds\text{Total Worst-Case Time} = 19.8\text{ ms} + 2000\text{ ms} + 20\text{ ms} = \mathbf{2039.8\text{ ms}} \approx \mathbf{2.04\text{ seconds}}

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore I/O Scheduling questions