Disk Scheduling
NOTE: BE SURE TO REVIEW THIS HANDOUT PRIOR TO TAKING THE FINAL EXAM. YOU MAY COPY IT AND TAKE IT WITH YOU INTO THE FINAL EXAM.
Compute the mean service time for the following disk requests using the Shortest-Seek-Time-First algorithm.
Requests = <(20,0), (32,4), (10,8), (40,10)>
where for (a,b):
a = track number
b = time of arrival of request
t(i) = total time to services the
request that arrived at time i.
w(i) = time the request that arrived at time i spends waiting for service in
queue.
Time to move disk arm one track =
0.1
Start-up time if disk movement is needed = 6.0
Average latency = 10.0
Transfer time for one sector = 0.1
t(i) = w(i) + (tracks moved)*(0.1) + (0.0 or 6.0) + 10 + .01
Assume the disk head is initially
over track 0 and exactly one sector is transferred at every request. The
rectangular box below is the scheduling
queue and the asterisk indicates which request is selected from the queue.
|
*(20,0) |
Current Track = 0 |
At t = 0,
t(0) = 0 + 20*0.1 + 6 + 10 + 0.1 = 18.1
|
(32,4), *(10,8), (40,10) |
Current Track = 20 |
At t = (18.1 + 0) = 18.1,
t(8) = (18.1 - 8) + 10*0.1 + 6 + 10 + 0.1 = 27.2
|
*(32,4), (40,10) |
Current Track = 10 |
At t = (27.2 + 8) = 35.2,
t(4) = (35.2 - 4) + 22*.01 + 6 + 10 + 0.1 = 49.5
|
*(40,10) |
Current Track = 32 |
At t = (49.5 + 4) = 53.5,
t(10) = (53.5 = 10) + 8*0.1 + 6 + 10 + 0.1 = 60.4
Mean Service Time = (18.1 + 27.2 + 49.5 + 60.4)/4 = 38.8