Presentation is loading. Please wait.

Presentation is loading. Please wait.

DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.

Similar presentations


Presentation on theme: "DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK."— Presentation transcript:

1 DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK

2 Hard Disk Drives

3 Measure Disk Performance
Transfer rate is rate at which data flows between drive and computer Positioning time (random-access time) is time The time to move disk arm to desired cylinder (seek time) and the time for desired sector to rotate under the disk head (rotational latency) The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially Sector 0 is the first sector of the first track on the outermost cylinder

4 Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk bandwidth. Primary objective is: Minimize seek time Seek time  seek distance 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.

5 Disk Scheduling (Cont.)
Several algorithms exist to schedule the servicing of disk I/O requests. We illustrate them with a request queue (0-199). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53 Using FCFS find the total head movement in number of cylinders

6 Illustration shows total head movement of 640 cylinders.
FCFS  Cylinder Numbers Illustration shows total head movement of 640 cylinders.

7 FCFS Track Accessed No of tracks/cylinders covered AVG. Head movement
98-53 45 183-98 85 183-37 146 122-37 122-14 108 124-14 110 124-65 59 67-65 2 Total:- 640 cylinders 640/8=80 cylinders

8 Advantages/Disadvantages of FCFS
It is simple to implement Improved response time as a request gets response in fair amount of time Disadvantages: It involves a lot of random head movement and disk rotations 2. Throughput is not efficient 3. It is used in small systems where I/O efficiency is not important As the load on disk becomes more , FCFS tends to saturate the device and the response time become longer

9 Shortest Seek Time First(SSTF)
schedule the servicing of disk I/O requests with a request queue (0-199) 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53 Using SSTF find the total head movement in number of cylinders

10 Shortest Seek Time First(SSTF)
Selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.

11 SSTF (Cont.) Illustration shows total head movement of 236 cylinders.
 Cylinder Numbers Illustration shows total head movement of 236 cylinders.

12 SSTF (Cont.) Track Accessed No of tracks/cylinders covered
AVG. Head movement 65-53 12 67-65 2 67-37 30 37-14 23 98-14 84 122-98 24 59 Total:- 236 cylinders 236/8=29.50 cylinders

13 Advantages/Disadvantages of SSTF
The average head movement in FCFS was 80 cylinders, whereas in SSTF it is 29 cylinders. Thus there is a substantial improvement in disk throughput. Advantages: It minimizes latency time Better throughput than FIFO Disadvantages: Starvation may occur as some of the processes may have to wait for a long to satisfy the request.

14 SCAN/Elevator Algorithm
schedule the servicing of disk I/O requests with a request queue (0-199) 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53 Using SCAN/Elevator Algorithm find the total head movement in number of cylinders

15 SCAN/Elevator Algorithm
The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. Sometimes called the elevator algorithm.

16 SCAN/Elevator (Cont.)  Cylinder Numbers Illustration shows total head movement of 236 cylinders.

17 SCAN/Elevator (Cont.) Track Accessed No of tracks/cylinders covered
AVG. Head movement 53-37 16 37-14 23 14-0 14 0-65 65 65-67 2 67-98 31 122-98 24 59 Total:- 236 cylinders 236/9=26.22 cylinders

18 Advantages/Disadvantages of SCAN
Observation is that, if requests comes, it will be serviced immediately while the request arriving just behind the head will have to wait until disk head moves to the end of the disk, reverses direction and returns before being serviced. Advantages: No starvation Better throughput than FIFO and SSTF Disadvantages: Due to continuous scanning from end to end, the outer tracks are visited less often than the mid range tracks. The disk arm keeps scanning between two extremes, this may result in wear and tear of the disk assembly. Certain requests arriving ahead of the arm position would get immediate service but some other requests that arrive behind the arm position will have to wait for the arm to return back. So, the algorithm is not fair.

19 C-SCAN(One-Way Elevator)
C-SCAN is similar to SCAN Provides a more uniform wait time than SCAN. The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.

20 C-SCAN (Cont.)  Cylinder Numbers

21 C-SCAN/One Way Elevator
Track Accessed No of tracks/cylinders covered AVG. Head movement 53-65 12 65-67 2 67-98 31 98-122 24 59 16 199-0 ------ 0-14 14 14-37 23 Total:- 183cylinders 183/10=18.3 cylinders

22 Advantages/Disadvantages of C-SCAN
It is fair as compared to SCAN It provides more uniform waiting time Disadvantages: The time taken for the back swing is ignored The average head movements are more compared to SCAN This method increases the total seek time because of the long seek from the edge back to the hub The disk arm keeps scanning between two extremes, this may result in wear and tear of the disk assembly. Certain requests arriving ahead of the arm position would get immediate service but some other requests that arrive behind the arm position will have to wait for the arm to return back. So, the algorithm is not fair.

23 C-LOOK Version of C-SCAN
Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

24 C-LOOK (Cont.)

25 C_LOOK Track Accessed No of tracks/cylinders covered
AVG. Head movement 53-65 12 65-67 2 67-98 31 98-122 24 59 183-14 ------ 0-14 14 14-37 23 Total:- 167cylinders 167/9=18.55cylinders

26 Selecting a Disk-Scheduling Algorithm
SSTF is common and has a natural appeal SCAN and C-SCAN perform better for systems that place a heavy load on the disk. Performance depends on the number and types of requests. Requests for disk service can be influenced by the file-allocation method. The disk-scheduling algorithm should be written as a separate module of the operating system, allowing it to be replaced with a different algorithm if necessary. Either SSTF or LOOK is a reasonable choice for the default algorithm.

27 Example LOOK C-LOOK A. Frank - P. Weisberg

28 Example Suppose that the head of a moving disk with 200 tracks numbered 0 to 199 is currently servicing a request at Track 60 and the queue of requests is kept in the order 87,170, 40,150,36,72,66,15 ii) Track 143 and the queue of requests is kept in the order 86,147,91, 177,94,150,102,175,130 What is the total number of average head movements needed to satisfy the request for the following disk-scheduling algorithm a) FCFS b) SSTF c) SCAN d)Look e) C-Scan f) C-Look Answers: SLno FCFS SSTF SCAN Look C-Scan C-Look i) 69.6 30.5 35.6 59.2 ii) 62.77 18 18.77 13.88 42.77

29 RAID RAID – multiple disk drives provides reliability via redundancy.
Redundant Array of Independent Disks (RAID) RAID is arranged into six different levels. Several improvements in disk-use techniques involve the use of multiple disks working cooperatively. Disk striping uses a group of disks as one storage unit. RAID schemes improve performance and improve the reliability of the storage system by storing redundant data. Mirroring or shadowing keeps duplicate of each disk. Block interleaved parity uses much less redundancy.

30 RAID Levels

31 Raid Levels(continued)
Raid levels 0 through 2 Backup and parity drives are shaded

32 Raid Levels (continued)
Raid levels 3 through 5 Backup and parity drives are shaded

33 Raid Levels 6 and 7 RAID 6:P and Q redundancy
RAID 7: heterogeneous disks array


Download ppt "DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK."

Similar presentations


Ads by Google