os sheduling by asad and shafqat

Upload: musaab-qamar

Post on 05-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    1/14

    Disk Scheduling

    Operating system

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    2/14

    Presented by:

    Shafqat Mohammad Reg MC111004

    Asad Rauf Reg BC101008

    Sir Ijaz Gul

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    3/14

    Internal Structure of Hardisk

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    4/14

    The operating system is responsible for using

    hardware efficiently . for the disk drives, thismeans having a fast access time.

    Access time has two major components: Seek time :- Seek time is the time for the disk are to

    move the heads to the cylinder containing thedesired sector.

    Rotational latency :- Rotational latency is theadditional time waiting for the disk to rotate thedesired sector to the disk head.

    Disk Scheduling

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    5/14

    Disk drives are addressed as large

    1-dimensional arrays of logical blocks, where the logical block is the

    smallest unit of transfer.

    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.

    Mapping proceeds in order through that track, then the rest of the tracks

    in that cylinder, and then through the rest of the cylinders from outermost

    to innermost.

    Disk Structure

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    6/14

    Several algorithms exist to schedule theservicing of disk I/O requests.

    We illustrate them with a I/O request queue

    (cylinders are between 0-199):

    queue = 98, 183, 37, 122, 14, 124, 65, 67

    head starts at 53

    Disk Scheduling Algorithms

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    7/14

    Handle I/O requests sequentially.

    Fair to all processes.

    Approaches random scheduling inperformance if there are many

    processes/requests.

    Suffers from global zigzag effect.

    First Come First Serve (FCFS)

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    8/14

    FCFS Example..

    Illustration shows total head movement of 640 cylinders.

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    9/14

    Selects the request with the minimum seek

    time from the current head position.Also called Shortest Seek Distance First

    (SSDF) Its easier to compute distances.

    Its biased in favor of the middle cylindersrequests.

    SSTF scheduling is a form of SJF scheduling;

    may cause starvation of some requests.

    Shortest Seek Time First (SSTF)

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    10/14

    Example -

    Illustration shows total head movement of 236 cylinders.

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    11/14

    Scan

    The disk arm starts at one end of the disk, and

    moves toward the other end, servicingrequests until it gets to the other end of thedisk, where the head movement is reversedand servicing continues.

    It moves in both directions until both ends.

    Tends to stay more at the ends so more fair tothe extreme cylinder requests.

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    12/14

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    13/14

    C-Scan

    The head moves from one end of the disk to theother, servicing requests as it goes. When itreaches the other end, however, it immediatelyreturns to the beginning of the disk, withoutservicing any requests on the return trip.

    Treats the cylinders as a circular list that wrapsaround from the last cylinder to the first one.

    Provides a more uniform wait time than SCAN; ittreats all cylinders in the same manner.

  • 7/31/2019 Os Sheduling by Asad and Shafqat

    14/14

    Example..