Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITEC 202 Operating Systems

Similar presentations


Presentation on theme: "ITEC 202 Operating Systems"— Presentation transcript:

1 ITEC 202 Operating Systems
EASTERN MEDITERRANEAN UNIVERSITY SCHOOL OF COMPUTING AND TECHNOLOGY Disk Scheduling ITEC 202 Operating Systems

2 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.

3 When a disk drive is operating, it is rotating at a constant speed.
Disk Performance Parameters When a disk drive is operating, it is rotating at a constant speed. 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”.

4 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”. 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.

5 When disk drive is operating, disk is rotating at constant speed.
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. Time it takes for beginning of sector to reach head is known as rotational delay or rotational latency.

6 Timing of a Disk I/O transfer
A general timing line diagram of disk I/O transfer is shown below:

7 Timing of a Disk I/O transfer
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.

8 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.

9 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

10 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.

11 Random Scheduling 184 38 150 160 90 18 39 58 55 Read 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.

12 First-In-First-Out (FIFO)
The simplest policy could be scheduling the requests on first come first serve base.

13 FIFO First-In-First-Out FIFO 55.3 55 45 58 3 39 19 18 21 90 72 160 70
55 45 58 3 39 19 18 21 90 72 track number the arm movement 55.3

14 Priority 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.

15 Last In First Out (LIFO)
It is very interesting to note that system always taking the most recent observation performs quite well. 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.

16 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.

17 Shortest Service Time First
SSTF SSTF 90 10 58 32 55 3 39 16 38 1 18 20 track number 27.5 the arm movement

18 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.

19 Scan Policy SCAN 90 94 58 32 55 3 39 16 38 1 18 20 track number 27.8 the arm movement

20 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.

21 Circular Scan C-SCAN C-Scan 35.8 150 50 160 10 184 24 18 166 38 20
38 20 39 1 55 16 58 3 90 32 track number 35.8 the arm movement

22 N-Scan and F-Scan 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.

23 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. 184 38 150 160 90 18 39 58 55 N=3

24 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. New requests wait in this queue Queue 1 184 38 150 160 90 18 39 58 55 Queue 2

25 example 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: FIFO, SSTF, SCAN, C-SCAN and N-SCAN (N=2). Also calculate average seek length for each of the following scheduling policies.

26 FIFO FIFO 16 28.2

27 SSTF SSTF 20.2

28 SCAN SCAN 18.8

29 C-SCAN C-SCAN 24.8

30 N-SCAN (N=2) C-SCAN 27.8

31 End of Chapter Prepared by, Ahmet Rizaner 05 May 2008


Download ppt "ITEC 202 Operating Systems"

Similar presentations


Ads by Google