edited by
463 views
5 votes
5 votes

At a particular point in time, the buffer cache has dirty data that needs to be flushed to disk. Suppose that the identities of these blocks can be listed in [track:sector] form as follows:
$$[10:5], [22:9], [11:6], [2:10], [20:5], [32:4], [32:5], [6:7]$$
Assume that the disk head is currently positioned over track $20.$

Which of the following disk scheduling algorithms yield the following sequence of writes:
$$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$$

  1. Shortest Seek Time First
  2. Scan (initially moving upwards)
  3. Look (initially moving upwards)
  4. C-SCAN (initially moving upwards)
edited by

1 Answer

3 votes
3 votes
Shortest Seek Time First:

$$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$$

In breaking the tie between $[32:4]$ and $[32:5], $ we picked sector order, so that we can pull them consecutively from disk without extra rotations.

Scan (initially moving upwards):

$[20:5], [22:9], [32:4], [32:5], [11:6], [10:5], [6:7], [2:10]$

In this particular case, notice that both SSTF and Scan yield the same result.
edited by
Answer:

Related questions