0
36kviews
We assume a disk with 200 tracks and disk request queue has random requests in it. The requested disks in the order are 55,58,39,18,90,160,150,38,184 starting with a track 100.

Calculate average seek length using FIFO ,SSTF, SCAN , C-SCAN. Give which disk scheduling is best for this scenario.

1 Answer
5
3.3kviews

First Come First Serve (FCFS) Disk Scheduling

FCFS

Total Head Movements

= (100 - 55) + (58 - 55) + (58 - 39) + (39 - 18) + (90 - 18) + (160 - 90) + (160 - 150) + (150 - 38) + (184 - 38)

= 45 + 3 + 19 + 21 + 72 + 70 + 10 + 112 + 146

= 498 Cylinders

Average Seek Length = 498/9 = 55.34 ms

Shortest Seek Time First (SSTF) Disk Scheduling

SSTF

Total Head Movements

= (100 - 90) + (90 - 58) + (58 - 55) + (55 - 39) + (39 - 38) + (38 - 18) + (150 - 18) + (160 - 150) + (184 - 160)

= 10 + 32 + 3 + 16 + 1 + 20 + 132 + 10 + 24

= 248 Cylinders

Average Seek Length = 248/9 = 27.56 ms

SCAN (Elevator) Disk Scheduling

SCAN

Total Head Movements

= (150 - 100) + (160 - 150) + (184 - 160) + (199 - 184) + (199 - 90) + (90 - 58) + (58 - 55) + (55 - 39) + (39 - 38) + (38 - 18)

= 50 + 10 + 24 + 15 + 109 + 32 + 3 + 16 + 1 + 20

= 280 Cylinders

OR

Total Head Movements = (199 - 100) + (199 - 18) = 99 + 181 = 280 Cylinders

Average Seek Length = 280/10 = 28 ms

C-SCAN (Circular SCAN) Disk Scheduling

C-SCAN

Total Head Movements

= (150 - 100) + (160 - 150) + (184 - 160) + (199 - 184) + (199 - 0) + (18 - 0) + (38 - 18) + (39 - 38) + (55 - 39) + (58 - 55) + (90 - 58)

= 50 +10 + 24 + 15 + 199 + 18 + 20 + 1 + 16 + 3 + 32

= 388 Cylinders

OR

Total Head Movements = (199 - 100) + (199 - 0) + (90 - 0) = 99 + 199 + 90 = 388 Cylinders

Average Seek Length = 388/11 = 35.28 ms

All the above findings of total head movements and average seek lengths indicate Shortest Seek Time First (SSTF) Disk Scheduling Algorithm is best for this scenario because it has a low number of total head movements as well as a low average length as compared to the other three disk scheduling algorithms.

Please log in to add an answer.