Consider a disk system with 100 cylinders. The requests to access the cylinders occur in the following sequence: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20
119 ms
Disk scheduling is a crucial part of operating systems that manages the order in which disk I/O requests are serviced. The goal is typically to minimize the total head movement and thus the access time, improving the overall performance of the disk.
The question asks us to apply the Shortest Seek Time First (SSTF) disk scheduling policy. SSTF chooses the request closest to the current head position. This strategy aims to minimize the immediate seek time but can sometimes lead to starvation for requests located far away from the current position.
We are given the following information:
We need to find the total time taken to service all requests using the SSTF algorithm.
The SSTF algorithm works by selecting the request that has the minimum distance from the current head position among all pending requests. We start at cylinder 50 and service the requests one by one based on this policy.
Let's trace the execution:
Let's sum the head movements for each step:
| From Cylinder | To Cylinder | Head Movement (cylinders) |
|---|---|---|
| 50 | 34 | \(|50 - 34| = 16\) |
| 34 | 20 | \(|34 - 20| = 14\) |
| 20 | 19 | \(|20 - 19| = 1\) |
| 19 | 15 | \(|19 - 15| = 4\) |
| 15 | 10 | \(|15 - 10| = 5\) |
| 10 | 7 | \(|10 - 7| = 3\) |
| 7 | 6 | \(|7 - 6| = 1\) |
| 6 | 4 | \(|6 - 4| = 2\) |
| 4 | 2 | \(|4 - 2| = 2\) |
| 2 | 73 | \(|2 - 73| = 71\) |
Total head movement = \(16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119\) cylinders.
The time taken to move from one cylinder to an adjacent one is given as 1 ms.
Total time = Total head movement \(\times\) Time per cylinder movement
Total time = \(119 \text{ cylinders} \times 1 \text{ ms/cylinder} = 119 \text{ ms}\).
Therefore, the total time taken to satisfy all requests using the SSTF policy is 119 ms.
| Concept | Description |
|---|---|
| SSTF Policy | Always chooses the request with the shortest seek time from the current head position. |
| Goal | Minimize head movement, potentially reducing average access time. |
| Potential Issue | Can lead to starvation if requests far away from the current position are continuously bypassed by closer requests. |
| Calculation | Sum of absolute differences between current head position and the next chosen cylinder position, for each step. |
SSTF is one of several disk scheduling algorithms. Other common algorithms include:
Each algorithm has its own trade-offs in terms of average seek time, variance in seek time, and fairness (preventing starvation).
Disc is divided into several concentric circles called _______.
In _______ disk scheduling algorithm, the disk head moves from one end to other end of the disk, serving the requests along the way. When the head reaches the other end, it immediately returns to the beginning of the disk without serving any requests on the return trip.
The total storage capacity of a floppy disk having 80 tracks and storing 128 bytes/sector is 163.840 bytes. How many sectors does this disk have?
Consider a disk system having 60 cylinders. Disk requests are received by a disk drive for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. Assuming the disk head is currently at cylinder 20, what is the time taken to satisfy all the requests if it takes 2 milliseconds to move from one cylinder to an adjacent one and Shortest Seek Time First (SSTF) algorithm is used ?
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, 67. Suppose SSTF disk scheduling algorithm implemented to meet the requests then the total number of head movements are ______ if the disk head is initially at 53.