DISK SCHEDULING ALGORITHMS
A hard disk drive is a collection of plates called platters. The surface of each platter is divided into circular tracks. Further more, each track is divided into smaller pieces called sectors. Disk I/O is done sector by sector. A group of tracks that are positioned on top of each other form a cylinder. There is a head connected to an arm for each surface, which handles all I/O operations.
For each I/O request, first head is selected. It is then moved over the destination track. The disk is then rotated to position the desired sector under the head= and finally, the read/write operation is performed.
There are two objectives for any disk scheduling algorithm:
1. Minimize the throughput - the average number of requests satisfied per time unit.
2. Maximize the response time - the average time that a request must wait before it is satisfied.
1. Minimize the throughput - the average number of requests satisfied per time unit.
2. Maximize the response time - the average time that a request must wait before it is satisfied.
Some of the disk scheduling algorithms are explained below.
- FCFS (First Come, First Served)
- perform operations in order requested
- no reordering of work queue
- no starvation: every request is serviced
- poor performance
- SSTF (Shortest Seek Time First)
- after a request, go to the closest request in the work queue, regardless of direction
- reduces total seek time compared to FCFS
- Disadvantages
- starvation is possible; stay in one area of the disk if very busy
- switching directions slows things down
- SCAN
- go from the outside to the inside servicing requests and then back from the outside to the inside servicing requests.
- repeats this over and over.
- reduces variance compared to SSTF.
- LOOK
- like SCAN but stops moving inwards (or outwards) when no more requests in that direction exist.
- C-SCAN (circular scan)
- moves inwards servicing requests until it reaches the innermost cylinder; then jumps to the outside cylinder of the disk without servicing any requests.
- repeats this over and over.
- variant: service requests from inside to outside, and then skip back to the innermost cylinder.
- C-LOOK
- moves inwards servicing requests until there are no more requests in that direction, then it jumps to the outermost outstanding requests.
- repeast this over and over.
- variant: service requests from inside to outside, then skip back to the innermost request.
Comments