Consider a disk queue with I/O requests on the following cylinders in their…

2017

Consider a disk queue with I/O requests on the following cylinders in their arriving order : 6, 10, 12, 54, 97, 73, 128, 15, 44, 110, 34, 45 The disk head is assumed to be at cylinder 23 and moving in the direction of decreasing number of cylinders. Total number of cylinders in the disk is 150. The disk head movement using SCAN-scheduling algorithm is :

  1. A.

    172

  2. B.

    173

  3. C.

    227

  4. D.

    228

Attempted by 117 students.

Show answer & explanation

Correct answer: A

Solution: Compute total head movement using the SCAN (elevator) algorithm. Assume cylinders are numbered 0 to 149 (total 150). The head starts at 23 and is moving toward decreasing cylinder numbers (toward 0). SCAN goes to the end before reversing.

  • Serve requests below 23 in descending head path order: 15, 12, 10, 6.

  • Distances for this pass: 23 → 15 = 8, 15 → 12 = 3, 12 → 10 = 2, 10 → 6 = 4. Sum = 8 + 3 + 2 + 4 = 17.

  • Continue to the start of the disk (cylinder 0): 6 → 0 = 6. Total distance for the downward pass = 17 + 6 = 23.

  • Reverse direction and serve remaining requests in increasing order: 34, 44, 45, 54, 73, 97, 110, 128.

  • Distances on the upward pass: 0 → 34 = 34, 34 → 44 = 10, 44 → 45 = 1, 45 → 54 = 9, 54 → 73 = 19, 73 → 97 = 24, 97 → 110 = 13, 110 → 128 = 18. Sum = 34 + 10 + 1 + 9 + 19 + 24 + 13 + 18 = 128.

  • SCAN continues to the far end of the disk (cylinder 149) on this pass: 128 → 149 = 21.

Total head movement calculation:

Downward pass total = 23; upward pass total = 128; final move to cylinder 149 = 21. Grand total = 23 + 128 + 21 = 172 cylinders.

Answer: 172

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor