Disk scheduling examples
Problem parameters: u Disk has 100 cylinders, labeled 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
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
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
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) (16 – 3) (58 – 16) (98 – 58) + 1+ (98 – 71) (71 –12) (56 – 12) + 1 Arrival TimeCylinder
FCFS Arrival TimeCylinder
FCFS Arrival TimeCylinder
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) (98 – 58) +1 + (99–98) + (99 – 16) (16 – 12) (12 – 0) + (56 – 0) (71 – 56) + 1 Arrival TimeCylinder
Scan Arrival TimeCylinder [101]
Scan Arrival TimeCylinder
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) (16 – 3) +1 + (58–16) (98 – 58) (98 – 71) (71 – 38) + (56 – 38 ) (56 – 12) + 1 = 249 Arrival TimeCylinder
SSTF Arrival TimeCylinder
SSTF C = 38 at – 12 = – 38 = Arrival TimeCylinder