1 / 9

Disk Scheduling

Disk Scheduling. Manav Sethi 11CS30044. Introduction. OS maintains a queue of requests per disk/device. Only an idle disk can work on an I/O request. Device controllers have small buffers to maintain queue of requests.

maxine
Download Presentation

Disk Scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Disk Scheduling Manav Sethi 11CS30044

  2. Introduction • OS maintains a queue of requests per disk/device. • Only an idle disk can work on an I/O request. • Device controllers have small buffers to maintain queue of requests. • Given the list of track numbers to get data from, the disk scheduler determines the sequence in which to execute requests.

  3. Disk Scheduling Algorithms • First-Come-First-Serve(FCFS) – The request which came first is satisfied first. Average seek time depends on order of arrival of request. • Shortest Seek Time First(SSTF) – Selects the request with the minimum seek time from current head position. • Starvation – Far away requests may not be satisfied. • Local Maxima(Greedy) – Not optimal. • Frequent change in direction of head takes time.

  4. Disk Scheduling Algorithms • SCAN – Move the head in one direction at a time till you reach an end of the disk. Now revert the direction and go to the other end. Keep satisfying requests in between. • It has less changes in direction of head. • While satisfying request on one side of disk, request on the other side get clustered. When these requests are satisfied then the other side gets clustered even more and so on. This keeps on increasing waiting time of requests • C-SCAN – Serve requests only in one direction i.e. when you reach end of a disk then jump directly to the other end without satisfying requests in between. • Less clustering. • Ensures fairness.

  5. Disk Scheduling Algorithms • LOOK/C-LOOK – Similar to SCAN/C-SCAN. Different in that they serve request only till the last request on either side of side i.e. don’t go till end of disk unnecessarily.

  6. Selecting a Disk Scheduling Algorithm • Depends on File Allocation Method being used (Contiguous or Indexed) • Contiguous – FCFS is sufficient to keep it simple. • Indexed – Smart Algorithm is needed. SSTF or LOOK is the default.

  7. How disk based queuing affects OS ordering? • Physical block information is not known to OS. The Disk Controller knows it. • But Disk Controller does not know which process a request belongs to or it’s semantic importance. • So Demand Paging must get preference over normal I/O. • File Organization Module ensures this order. When Pager is satisfied, then only other requests are sent.

  8. Disk Management • Low-Level or Physical Formatting – Dividing a disk into sectors that disk controller can read/write. • Each sector has header, Error Correction Code and data. • High-Level or Logical Formatting(Partitioning) – Divide the disk into separate partitions for different OS. • Each partition has required data structures like Boot Block, Partition Control Block. • Bad Blocks – • Sector sparing used to handle bad blocks. • Map each bad block to a spare block.

  9. Application I/O Interface • I/O subsystem – Contains tasks common to all devices like read/write • An abstraction • Provides interface to device drivers to interact with OS. • Device Drivers must be compatible with the I/O subsystem.

More Related