Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Disk scheduling


Published on

Disc scheduling in operating system

Published in: Engineering
  • Be the first to comment

Disk scheduling

  2. 2. Disk Scheduling  The operating system is responsible for using hardware efficiently for the disk drives, this means the disk having a  FAST ACCESS TIME  DISK BANDWIDTH  Access time has two major components  Seek time is the time for the disk to move the heads to the cylinder containing the desired sector.  Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head 2
  3. 3. Disk Scheduling (Cont.)  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. 3
  4. 4. 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 4
  5. 5. FCFS •  All incoming requests are placed at the end of the queue. • Whatever number that is next in the queue will be the next number served Using this algorithm doesn't provide the best results. • To determine the number of head movements we would simply find the number of tracks it took to move from one request to the next. 5
  6. 6. FCFS 6 Illustration shows total head movement of 640 cylinders.
  7. 7. Why do we study it or use it ? • Disk scheduling is studied or used because :- • it provide the better solution to minimize the access time required to read/write data to hard disk. • If we not use disk scheduling then read/write time is more and overhead. • But operating system is responsible for managing the hardware efficiently that’s why we use disk scheduling. 7
  8. 8. 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. • Illustration shows total head movement of 236 cylinders. 8
  9. 9. SSTF (Cont.) 9
  10. 10. SCAN 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. Illustration shows total head movement of 208 cylinders. 10
  11. 11. SCAN (Cont.) 11
  12. 12. C-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. 12
  13. 13. C-SCAN (Cont.) 13
  14. 14. 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. 14
  15. 15. C-LOOK (Cont.) 15
  16. 16. How to choose better algorithm? • If we confuse about selecting the disk scheduling algorithm then we should be writing disk scheduling algorithms in separate module of operating system. So that we can easily switch to other scheduling algorithm. • To select better algorithm for disk scheduling is depends upon the different factors such as the if the system place heavy load on the disk then we can select SCAN or C-SCAN. Because of the in SCAN and C-SCAN algorithms head movements is not switching every time it only switch when the end of disk is gets. • In normal way we can choose the SSTF or LOOK scheduling algorithm. Because of it’s reasonable result. 16
  17. 17. 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. 17
  18. 18. Summary • We looked various disk scheduling methods to optimize secondary storage access • Total time required to access the hard disk is calculated as following • Total Time required to access= Seek time + Rotation Latency + Transfer time. 18
  19. 19. 19