Download presentation
Presentation is loading. Please wait.
Published byCarina Tolles Modified over 9 years ago
1
Disk scheduling examples
2
Problem parameters: u Disk has 100 cylinders, labeled 0-99. u Time to move from cylinder A to cylinder B is a linear function of |A – B| u Time to read a block stored at the current cylinder is the same as the time to move one cylinder
3
Problem statement u Assume block requests arrive according to table to the right u Assume, at time 0, the read- write heads are positioned above cylinder 28. u Requests with identical arrival time are listed in FIFO order u Requests with arrival time of 0 are pending when the simulation begins u All times are given in cylinder movement units Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
4
FCFS u Assume, when no requests are pending, the R/W heads do not move. u What is the total time to service all requests? Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
5
FCFS u Assume, when no requests are pending, the R/W heads do not move. u What is the total time to service all requests? u (28 – 3) + 1 + (16 – 3) + 1 + (58 – 16) + 1 + (98 – 58) + 1+ (98 – 71) + 1 + (71 –12) + 1 + (56 – 12) + 1 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
6
FCFS 312162856587198 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 0 26 40 83 124 152 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
7
FCFS 312162856587198 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 212 257 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
8
Scan u Assume the R/W heads are moving towards cylinder 99 when the simulation begins u What is the total time to service all requests? (58 – 28) + 1 + (98 – 58) +1 + (99–98) + (99 – 16) + 1 + (16 – 12) + 1 + (12 – 0) + (56 – 0) + 1 + (71 – 56) + 1 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
9
Scan 312162856587198 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 0 31 72 157 162 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556 [101]
10
Scan 312162856587198 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 172 231 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556 247
11
SSTF u Assume the R/W heads continue moving toward cylinder 50 when there is no pending request, and that seek decisions can be changed dynamically u What is the total time to service all requests? (28 – 3) + 1 + (16 – 3) +1 + (58–16) + 1 + (98 – 58) + 1 + (98 – 71) + 1 + (71 – 38) + (56 – 38 ) + 1 + (56 – 12) + 1 = 249 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556
12
SSTF 312162856587198 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 0 27 83 124 152 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556 13
13
SSTF 312162856587198 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 C = 38 at 185 38 – 12 = 26 56 – 38 = 18 249 Arrival TimeCylinder 03 416 2058 5198 11371 13112 18556 204
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.