OPERATING SYSTEMS: DISK SCHEDULING PLEASE SHOW YOUR WORK! I\'M TRYING TO UNDERSTAND HOW TO ACTUALLY DO THE PROBLEM. 2. (3 points) Suppose that a disk drive has 3000 cylinders, numbered 0 to 2999. The drive is currently serving a request at cylinder 140, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is 66, 147, 913, 289, 202, 1750, 15 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms? a. FCFS b. SSTF c. SCAN d. LOOK e. C-SCAN 3. Requests are not usually uniformly distributed. For example, a cylinder containing the file system FAT or inodes can be expected to be accessed more frequently than a cylinder that only contains files. Suppose you know that 50 percent of the requests are for a small, fixed number of cylinders. Propose a disk-scheduling algorithm (one that we have discussed) that gives even better performance by taking advantage of this “hot spot” on the disk. Explain your answer and discuss any problems and how you might mitigate them. Solution The drive is currently serving a request at cylinder 140 request queue -- 66,147,913,289,202,1750,15 a) FCFS 66<--- 140 66---->147 147 ----> 913 289 <----- 913 202<---- 289 202 ------>1750 15 <------ 1750 total time = |66-140|+|66-147|+|147-913|+|289-913|+||202-289|+|202-1750|+|15-1750| =74+81+766+624+87+1548+1735 =4915 b) SSTF 140 ----> 147 147 ------>202 202----->289 66<----289 15<----66 15----->913 913----->1750 total time=7+55+87+223+51+898+837 =2158 c) SCAN 140--->147---->202---->289----->913----->1750----->2999--- 0<-----15<------66<----------------------------------------------- total time = |140-147|+|147-202|+|202-289|+|289-913|+|913-1750|+|1750-2999|+|2999-66|+|66- 15|+|15-0| =7+55+87+624+837+1249+2933+51+15 =5858 d)LOOK 140--->147---->202---->289----->913----->1750--- 15<------66<----------------------------------------------- total time = |140-147|+|147-202|+|202-289|+|289-913|+|913-1750|+|1750-66|+|66-15| =7+55+87+624+837+1684+51 =3345 e)C-SCAN 140--->147---->202---->289----->913----->1750----->2999--- 66<-----15<------0<----------------------------------------------- total time = |140-147|+|147-202|+|202-289|+|289-913|+|913-1750|+|1750-2999|+|2999-0|+|15- 0|+|66-15| =7+55+87+624+837+1249+2999+15+51 =5924 SSTF can be the best disk scheduling algorithm when data is close to each other. We can have hot spot in the middle of the disk . Aging can be done on older request by increasing their priority.