DISK SCHEDULING :-
It is responsibility of the operating system to use the hardware efficiently. For magnetic disks, the access time has two major components, The seek time and rotational latency. The disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer.
We can improve both the access time and the bandwidth by managing the order in which disk I/O requests are serviced. Whenever a process needs I/O to or from the disk, it issues a system call to the operating system. The request specifies several pieces of information :-
• Mode of operation (input or output).
• Disk address for the transfer.
• Memory address for the transfer.
• The number of sectors to be transferred.
If the desired disk drive and controller are available, the request can be serviced immediately. If the drive or controller is busy, any new requests for service will be placed in the queue of pending requests for that drive.
TYPES OF DISK SCHEDULING :-
1. FCFS scheduling :-
FCFS scheduling is the simplest form of disk scheduling. Its full form is first-come first-served algorithm. This algorithm is fair but it generally does not provide the fastest service. For example, a disk queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, 67, in that order.
If the disk head is initially at cylinder 53, it will first move from 53 to 98, then to 183, 37, 122, 14, 124, 65, and finally to 67, for a total head movement of 640 cylinders.
2. SSTF Scheduling :-
Its full form is shortest-seek-time-first (SSTF) algorithm. It services all the requests close to the current head position before moving the head far away to service other requests. The SSTF algorithm
selects the request with the least seek time from the current head position. In other words, SSTF chooses the pending request closest to the current head position.
For our example request queue, the closest request to the initial head position (53) is at cylinder 65. Once we are at cylinder 65, the next closest request is at cylinder 67. From there, the request at cylinder 37 is closer than the one at 98, so 37 is served next. Continuing, we service the request at cylinder 14,
then 98, 122, 124, and finally 183 (Figure 10.5). This scheduling method results
in a total head movement of only 236 cylinders. This algorithm gives a substantial improvement in performance. SSTF scheduling is essentially a form of shortest-job-first (SJF) scheduling.
3. SCAN Scheduling :-
This scheduling algorithm is also known as elevator algorithm because in this scheduling, the disk arm behaves just like an elevator in a building . In the SCAN algorithm, the disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues. The head continuously scans back and forth across the disk.
In our example, before applying SCAN algorithm to schedule the requests on cylinders 98, 183, 37, 122, 14, 124, 65, and 67, we need to knowthe direction of head movement in addition to the head’s current position. Assuming that the disk arm is moving toward 0 and that the initial head position is again 53, the head will next service 37 and then 14. At cylinder 0, the arm will reverse and will move toward the other end of the disk, servicing the requests at 65, 67, 98, 122, 124, and 183. If a request arrives in the queue just in front of the head, it will be serviced almost immediately and if a request arriving just behind the head will have to wait until the arm moves to the end of the disk.
4. CSCAN Scheduling :-
Its full form is Circular SCAN scheduling. It is a variant of SCAN designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other, servicing requests along the way.
When the head reaches the other end, it immediately returns to the beginning of the disk without servicing any requests on the return trip. The C-SCAN scheduling algorithm essentially treats the cylinders as a circular list that wraps around from the final cylinder to the first one.
5. LOOK Scheduling :-
Both SCAN and C-SCAN move the disk arm across the full width of the disk. In practice, neither algorithm is often implemented this way. More commonly, the arm goes only as far as the final request in each direction. Then, it reverses direction immediately,without going all the way to the end of the disk. Versions of SCAN and C-SCAN that follow this pattern are called LOOK and C-LOOK scheduling, because they look for a request before continuing to move in a given direction.
Share, Follow and please comment if you find anything incorrect or to share more information about the topic discussed above
Comments
Post a Comment
Please comment.