
Disk Performance Parameters in Operating Systems
Explore the significance of disk I/O operations and performance parameters in operating systems, including seek time, rotational delay, and access time. Learn how these factors influence the efficiency of data transfer on disk drives.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
EASTERN MEDITERRANEAN UNIVERSITY SCHOOL OF COMPUTING AND TECHNOLOGY ITEC202 Operating Systems Disk Scheduling ITEC 202 Operating Systems 1 Prepared by Dr. Ahmet Rizaner
Disk Performance Parameters Normally the disk I/O operation depends on the computer system, the nature of the I/O channel and disk controller hardware. ITEC202 Operating Systems 2 Prepared by Dr. Ahmet Rizaner
Disk Performance Parameters When a disk drive is operating, it is rotating at a constant speed. ITEC202 Operating Systems To read or write from the disk the head must be positioned over the track and at the beginning of the desired sector. The time that takes to position head on top of the track is known as seek time . 3 Prepared by Dr. Ahmet Rizaner
Disk Performance Parameters The time it takes for the beginning of the sector to reach the head is known as rotational delay or rotational latency . ITEC202 Operating Systems Sum of these two times is known as access time (seek time + rotational delay). It is the time it takes to get in position to read or write. Once the head is on top of the track as well as sector the data transfer (read or write) operation begins. 4 Prepared by Dr. Ahmet Rizaner
Disk Performance Parameters Performance Parameters When disk drive is operating, disk is rotating at constant speed. On a movable-head system, time it takes to position head at track is known as seek time. ITEC202 Operating Systems Time it takes for beginning of sector to reach head is known as rotational delay or rotational latency. 5 Prepared by Dr. Ahmet Rizaner
Timing of a Disk I/O transfer A general timing line diagram of disk I/O transfer is shown below: ITEC202 Operating Systems Wait for Device Wait for Channel Rotational Delay Data Transfer Seek Device Busy 6 Prepared by Dr. Ahmet Rizaner
Timing of a Disk I/O transfer Wait for Device Wait for Channel Rotational Delay Data Transfer Seek Device Busy ITEC202 Operating Systems When an I/O operation is requested, it may have to wait in queue if the device is not ready. Also in some cases there is a single channel for different I/O devices; therefore, it may have to wait till that channel is available. 7 Prepared by Dr. Ahmet Rizaner
Disk Arm Scheduling Policies The order in which sectors are read form the disk has great effect on I/O performance. In a multiprogramming systems, a number of I/O requests may be competing for the same disk and if random approach is used, then performance of such systems will be poor Therefore, some improvement has to be done in order to improve the disk access time. ITEC202 Operating Systems 8 Prepared by Dr. Ahmet Rizaner
Disk Arm Scheduling Policies First-In-First-Out (FIFO) Priority Last In First Out (LIFO) Shortest Service Time First (SSTF) Scan C-Scan N-Scan F-Scan ITEC202 Operating Systems 9 Prepared by Dr. Ahmet Rizaner
example: Assume that the disk head is initially located at track 100. We also assume a disk with 200 tracks and the disk request queue has random requests in it. The requested tracks, in the order received by the disk scheduler, are 55, 58, 39, 18, 90, 160, 150, 38 and 184. ITEC202 Operating Systems 10 Prepared by Dr. Ahmet Rizaner
Random Scheduling Read 184 58 55 150 39 160 90 18 38 ITEC202 Operating Systems Queue of Requested Tracks If we select items from the queue in random order, than we can expect that the tracks to be visited will occur randomly, giving poor performance. That is called random scheduling and is useful as a benchmark against which to evaluate other techniques. 11 Prepared by Dr. Ahmet Rizaner
First-In-First-Out (FIFO) ITEC202 Operating Systems The simplest policy could be scheduling the requests on first come first serve base. 12 Prepared by Dr. Ahmet Rizaner
First-In-First-Out FIFO FIFO Starting at track 100 Next track accessed Number of Tracks traversed 45 3 19 21 72 70 10 112 146 CSIT202 / CPIT142 Operating Systems 184 38 150 160 90 18 39 58 55 Queue of Requested Tracks 55 58 39 18 90 160 150 38 184 200 180 160 140 track number Track number 120 100 80 60 40 20 0 0 100 200 300 400 500 Average seek the arm movement Time 55.3 length 13
Priority ITEC202 Operating Systems Basically in a system based on priority mechanism the scope is outside the control of disk management software. e.g., often small jobs are given priority over longer jobs, this way basically lots of smaller jobs are finished quickly and the good response is observed by the system. 14 Prepared by Dr. Ahmet Rizaner
Last In First Out (LIFO) It is very interesting to note that system always taking the most recent observation performs quite well. ITEC202 Operating Systems In transaction processing system, normally there is little arm movement during the sequential file access, so it increases the throughput and reduces the queue lengths. However, this type of mechanism leads to starvation problem. Once a system enters in an I/O request and fallen back from the head of the line, the job can never regain the head of the line unless the queue in front of it empties. 15 Prepared by Dr. Ahmet Rizaner
Shortest Service Time First (SSTF) In this type of policy: disk I/O request is selected which requires the least movement of the arm from its current position. Therefore, basically we are selecting a request with minimum seek time. But it should be remembered that minimum seek time dose not always guarantee that it will have minimum arm movement. In any case this performs better than FIFO. ITEC202 Operating Systems 16 Prepared by Dr. Ahmet Rizaner
Shortest Service Time First SSTF SSTF Starting at track 100 Next track accessed Number of Tracks traversed 10 32 3 16 1 20 132 10 24 CSIT202 / CPIT142 Operating Systems 184 38 150 160 90 18 39 58 55 Queue of Requested Tracks 90 58 55 39 38 18 150 160 184 200 180 160 140 track number 120 100 80 60 40 20 0 0 50 100 150 200 250 Average seek 27.5 length the arm movement 17
Scan (Look Policy) This policy scans in the direction of increasing track number satisfying all the requests in route until it reaches the last track in that direction. The arm movement is allowed only in one direction. It starts from 100 to 150, 160, 184 after that there is no track on this side so it goes to the maximum which is 90 and so on. It is also called LOOK policy. ITEC202 Operating Systems 18 Prepared by Dr. Ahmet Rizaner
Scan Policy SCAN Starting at track 100 Next track accessed Number of Tracks traversed 50 10 24 94 32 3 16 1 20 CSIT202 / CPIT142 Operating Systems 184 38 150 160 90 18 39 58 55 Queue of Requested Tracks 150 160 184 90 58 55 39 38 18 200 180 160 track number 140 120 100 80 60 40 20 0 0 50 100 150 200 250 Average seek 27.8 length the arm movement 19
Circular Scan (C-Scan) The only difference in this case is that the arm is restricted to one direction only. Therefore, when the last track in one direction is visited (in our case it is 184), the arm is returned to the opposite end of the disk and scan begins again. This reduces the delay experienced by new requests. ITEC202 Operating Systems 20 Prepared by Dr. Ahmet Rizaner
Circular Scan C-Scan C-SCAN Starting at track 100 Next track accessed Number of Tracks traversed 50 10 24 166 20 1 16 3 32 CSIT202 / CPIT142 Operating Systems 184 38 150 160 90 18 39 58 55 Queue of Requested Tracks 150 160 184 18 38 39 55 58 90 200 180 160 track number 140 120 100 80 60 40 20 0 0 50 100 150 200 250 300 350 Average seek 35.8 length the arm movement 21
N-Scan and F-Scan ITEC202 Operating Systems In the cases of SSTF, SCAN & CSCAN the arm may not move for a considerable time, that is one or more processes may have high access rate to one particular track, so they monopolize the entire disk by repeated requests. In order to avoid such problem the entire queue can be segmented, and after processing one segment completely and we can move to another segment. 22 Prepared by Dr. Ahmet Rizaner
N-step-Scan (N-Scan) The N-step-SCAN policy segments the disk request queue into sub queues of length N. Sub queues are processed using SCAN policy With large values of N this policy gives performance equal to SCAN, also with N=1 FIFO is adopted. ITEC202 Operating Systems N=3 184 38 150 160 90 18 39 58 55 23 Prepared by Dr. Ahmet Rizaner
F-Scan F-SCAN policy has basically two queues, when a scan begins all requests are in one queue and the new requests are added to the other queue. It processes new requests when the first queue requests are completely finished. ITEC202 Operating Systems New requests wait in this queue Queue 1 Queue 2 184 38 150 160 90 18 39 58 55 24 Prepared by Dr. Ahmet Rizaner
example Given requests for a single sector in tracks 25, 70, 35, 5 and 20. ITEC202 Operating Systems The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests: FIFO, SSTF, SCAN, C-SCAN and N-SCAN (N=2). Also calculate average seek length for each of the following scheduling policies. 25 Prepared by Dr. Ahmet Rizaner
Solution of example: FIFO Given requests for a single sector in tracks 25, 70, 35, 5 and 20. The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests. Also calculate average seek length for each of the following scheduling policies FIFO CSIT202 / CPIT142 Operating Systems Starting at track 41 Next track accessed Number of Tracks traversed 25 16 70 45 35 35 5 30 20 15 20 5 70 35 25 Queue of Requested Tracks Average seek 28.2 length 26
Solution of example: SSTF Given requests for a single sector in tracks 25, 70, 35, 5 and 20. The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests. Also calculate average seek length for each of the following scheduling policies SSTF CSIT202 / CPIT142 Operating Systems Starting at track 41 Next track accessed Number of Tracks traversed 35 6 25 10 20 5 5 15 70 65 20 5 70 35 25 Queue of Requested Tracks Average seek 20.2 length 27
Solution of example: SCAN Given requests for a single sector in tracks 25, 70, 35, 5 and 20. The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests. Also calculate average seek length for each of the following scheduling policies SCAN CSIT202 / CPIT142 Operating Systems Starting at track 41 Next track accessed Number of Tracks traversed 70 29 35 35 25 10 20 5 5 15 20 5 70 35 25 Queue of Requested Tracks Average seek 18.8 length 28
Solution of example: C-SCAN Given requests for a single sector in tracks 25, 70, 35, 5 and 20. The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests. Also calculate average seek length for each of the following scheduling policies C-SCAN CSIT202 / CPIT142 Operating Systems Starting at track 41 Next track accessed Number of Tracks traversed 70 29 5 65 20 15 25 5 35 10 20 5 70 35 25 Queue of Requested Tracks Average seek 24.8 length 29
Solution of example: N-SCAN (N=2) Given requests for a single sector in tracks 25, 70, 35, 5 and 20. The head at track 40 moving towards track 41. Indicate in which order the following disk scheduling techniques will process the requests. Also calculate average seek length for each of the following scheduling policies C-SCAN CSIT202 / CPIT142 Operating Systems Starting at track 41 Next track accessed Number of Tracks traversed 70 29 25 45 5 20 35 30 20 15 20 5 70 35 25 Queue of Requested Tracks Average seek 27.8 length 30
ITEC202 Operating Systems End of Chapter Prepared by, Ahmet Rizaner 05 May 2008 31 Prepared by Dr. Ahmet Rizaner