626 views
0 votes
0 votes
Suppose that a disk drive has $5,000$ cylinders, numbered $0$ to $4,999$. The drive is currently serving a request at cylinder $2,150$, and the previous request was at cylinder $1,805$. The queue of pending requests, in $FIFO$ order, is:
$2,069, 1,212, 2,296, 2,800, 544, 1,618, 356, 1,523, 4,965, 3681$

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$
$f. C-LOOK$

1 Answer

0 votes
0 votes

(1) FCFS:

  • The FCFS algorithm just follows the order of the requests given.

  • The FCFS schedule is: 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

  • Movements: 57 + 1384 + 557 + 861 + 826 + 561 + 487 + 728 + 1620

  • The total distance is: 7,081

(2) SSTF:

  • The SSTF algorithm starts a cylinder 143 and from there successively selects the shortest request from its current location.

  • The SSTF schedule is: 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774

  • Movements: 13 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24

  • The total distance is: 1,745

(3) SCAN:

  • The SCAN algorithm continues in the direction of the head servicing requests until the end of the disk. It then reverses, catching all requests back to the other end of the disk. The head continuously scans back and forth across the disk.

  • The SCAN schedule is: 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 130, 86

  • Movements: 770 + 35 + 74 + 448 + 39 + 241 + 24 + 3225 + 4869 + 44

  • The total distance is: 9,769

  • (4) LOOK:

  • The LOOK algorithm is just like the SCAN algorithm, except the disk head only goes as far as the last request in each direction.

  • The LOOK schedule is: 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86

  • Movements: 770 + 35 + 74 + 448 + 39 + 241 + 24 + 1644 + 44

  • The total distance is: 3,319

  • The C-SCAN schedule— 143, 913, 948, 1022, 1470, 1509, 1750, 1774,4999, 86, 130. The total seek distance is 9813. The C-LOOK schedule—  143, 913, 948, 1022, 1470, 1509,1750, 1774, 86, 130. The total seek distance is 3363.

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
4
akash.dinkar12 asked Mar 22, 2019
1,459 views
Why is rotational latency usually not considered in disk scheduling ? How would you modify $SSTF$, $SCAN$, and $C-SCAN$ to include latency optimization ?