2080 6

BIT204 · 2080 · 5 marks

Suppose that a disk drive has the cylinder numbered, 0 to 199 is currently serving a request at cylinder 143. The request queue is kept in the FIFO order 25, 17, 119, 197, 194, 15, 182, 115, and 183. What is the total head movement needed to satisfy these request for the following disk scheduling al

Suppose that a disk drive has the cylinder numbered, 0 to 199 is currently serving a request at cylinder 143. The request queue is kept in the FIFO order 25, 17, 119, 197, 194, 15, 182, 115, and 183. What is the total head movement needed to satisfy these request for the following disk scheduling algorithm. a) FCFS b) SSTF [5]

Operating SystemsChapter 9: Input Output and Disk ManagementDisk scheduling algorithmsNumerical: disk scheduling head movement

Disk Scheduling: FCFS and SSTF

Given Data

  • Cylinder range: 0 to 199
  • Current head position: 143
  • Request queue (FIFO): 25, 17, 119, 197, 194, 15, 182, 115, 183

a) FCFS (First Come First Served)

Service order: 143 → 25 → 17 → 119 → 197 → 194 → 15 → 182 → 115 → 183

FromToDistance
14325118
25178
17119102
11919778
1971943
19415179
15182167
18211567
11518368

$$\text{Total} = 118+8+102+78+3+179+167+67+68 = 790$$

FCFS total head movement = 790 cylinders


b) SSTF (Shortest Seek Time First)

Always move to the nearest pending request.

At every step the head jumps to whichever pending cylinder is closest, so the distances to all remaining requests are compared before each move.

CurrentNearest pending optionsChosenDistance
143119 (24), 115 (28), 182 (39)11924
119115 (4), 182 (63), 183 (64)1154
115182 (67), 183 (68), 25 (90)18267
182183 (1), 194 (12), 197 (15)1831
183194 (11), 197 (14)19411
194197 (3), 25 (169)1973
19725 (172), 17 (180)25172
2517 (8), 15 (10)178
1715 (2)152

Service order: 143 → 119 → 115 → 182 → 183 → 194 → 197 → 25 → 17 → 15

$$\text{Total} = 24+4+67+1+11+3+172+8+2 = 292$$

SSTF total head movement = 292 cylinders

Note that 119 has to be taken before 115, since $|143-119| = 24$ is smaller than $|143-115| = 28$. Servicing 115 first would violate the shortest-seek rule even though the two requests sit close together.


Summary

AlgorithmTotal Head Movement
FCFS790 cylinders
SSTF292 cylinders

SSTF greatly reduces head movement versus FCFS, at the risk of starvation for distant requests.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.