The document discusses various disk scheduling algorithms used by operating systems to optimize disk access time and efficiency. It describes common algorithms like First Come First Serve (FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, LOOK, and C-LOOK. For each algorithm, it provides an example to calculate the total seek length for a sample request queue. It then compares the performance of the different algorithms based on total and average seek lengths. In conclusion, it notes that SCAN and C-SCAN work best under heavy disk loads while SSTF and LOOK are commonly used default algorithms.
3. What is disk scheduling?
Servicing the disk I/O requests
Why disk Scheduling?
Use hardware efficiently
Disk scheduling includes
Fast access time (seek time+ rotational latency)
Introduction
4. If desired disk drive is available, request is served
immediately.
If busy, new request for service will be placed in the queue
of pending requests. When one request is completed, the
OS has to choose which pending request to service next.
I/O requests, OS handling
5. To read or write, the disk head must be positioned at the
desired track and at the beginning of the desired sector
Seek time
Time it takes to position the head at the desired track
Rotational delay or rotational latency
Time its takes for the beginning of the sector to reach the head
Data transfer time
Data transfer occurs as the sector moves under the head
Disk Performance Parameters
6. Seek time is the reason for differences in performance
For a single disk there will be a number of I/O requests
If requests are selected randomly, we will poor
performance
Disk Scheduling Policies
7. Work Queue: 23, 89, 132, 42, 187
There are 200 cylinders numbered from 0 – 199.
The disk head stars at number 100.
Example
8. Process request sequentially.
Fair to all processes, no starvation.
Approaches random scheduling in performance if there
are many processes.
First come, first serve(FCFS)
10. Select the disk I/O request that requires the least
movement of the disk arm from its current position.
Always choose the minimum Seek time.
Starvation is possible; stay in one area of the disk.
If very busy switching directions, slows things down.
Not the most optimal.
Shortest Service Time First (SSTF)
12. Arm moves in one direction only, satisfying all outstanding
requests until it reaches the last track in that direction
Direction is reversed
Sometimes called the elevator algorithm.
SCAN
14. Restricts scanning to one direction only
When the last track has been visited in one direction, the
arm is returned to the opposite end of the disk and the
scan begins again
C-SCAN
16. Segments the disk request queue into sub queues of
length N.
Sub queues are processed one at a time, using SCAN.
New requests added to other queue when queue is
processed.
N-step-SCAN
17. Two queues
One queue is empty for new requests
FSCAN
18. The LOOK algorithm is the same as the SCAN algorithm in
that it also honors requests on both sweep direction of the
disk head.
The arm goes only as far as final requests in each direction
and then reverses direction without going all the way to
the end.
LOOK
20. This is just an enhanced version of C-SCAN.
In this, the scanning doesn't go past the last request in the
direction that it is moving. It too jumps to the other end
but not all the way to the end, Just to the furthest request.
C-LOOK
22. FCFS SSTF SCAN C-SCAN LOOK C-LOOK
421 263 287 368 241 296
Total seek
length
84.2 52.6 57.4 73.6 48.2 59.2
Average
seek
length
Comparison of Disk Scheduling Algorithms
23. Performance depends on number of requests.
SCAN, C-SCAN for systems that place a heavy load on the
disk, as they are less likely to cause starvation.
Default algorithms, SSTF or LOOK
Conclusion
24. Operating Systems. William Stalling, 7th edition.
Example of Disk Scheduling Algorithms:
http://www2.cs.uregina.ca/~hamilton/courses/330/notes/io/node8.html
Disk Scheduling, Vaibhav Kumar Gupta
http://www4.comp.polyu.edu.hk/~csajaykr/myhome/teaching/eel358/ds.pdf
Operating System Concepts. Greg Gagne, Peter Baer Galvin, and
Abraham Silberschatz, 8th edition.
References