SlideShare una empresa de Scribd logo
1 de 33
Disk scheduling algorithms summary




                       http://raj-os.blogspot.in/   1
Recap


In the last class, you have learnt:

• LOOK and C-LOOK Scheduling




                       http://raj-os.blogspot.in/   2
• HOME     PREVIOUS TOPIC NEXT
• PREVIOUS QUESTION PAPERS FOR
  OS
• CPP TUTORIALS




            http://raj-os.blogspot.in/   3
Objectives

On Completion of this period, you would be able to know
• How to select a Disk-Scheduling algorithm

• Factors affecting the Disk-Scheduling algorithm

• Implementation of Disk-Scheduling algorithm

• Summary of disk scheduling algorithm




                        http://raj-os.blogspot.in/        4
Selection of a Disk-Scheduling algorithm


Given so many scheduling algorithms how do we

choose the best one?

• SSTF is common and has a natural appeal because it
  increases performance over FCFS




                       http://raj-os.blogspot.in/      5
Selection of a Disk-Scheduling Algorithm

• SCAN and C-SCAN perform better for systems that
  place a heavy load on the disk

• SCAN and C-SCAN are less likely to cause a
  starvation problem



                       http://raj-os.blogspot.in/   6
Selection of a Disk-Scheduling Algorithm

• For any particular list of requests we can define an
  optimal order of retrieval

• But the computations needed for finding a optimal
  schedule may not justify the savings over SSTF or
  SCAN


                      http://raj-os.blogspot.in/         7
Factors affecting Disk-Scheduling Algorithm


• With any scheduling algorithm

   – Performance depends heavily on the number and
     type of requests
• If the queue has only one outstanding request

   – All scheduling algorithms behave as FCFS


                     http://raj-os.blogspot.in/      8
Factors affecting Disk-Scheduling Algorithm
• Requests for disk service can be influenced by the file-
  allocation method
   – A program reading contiguously allocated file
      • Generate several requests that are close together on the disk
      • Resulting in limited head movement
   – A program reading linked or indexed allocated file
      • Generate several requests that include blocks scattered on the
        disk
      • Resulting in greater head movement
                          http://raj-os.blogspot.in/               9
Factors affecting Disk-Scheduling Algorithm


• The disk Scheduling algorithms considers only the seek
  distances

• For modern disks the rotational latency can be nearly as
  large as the average seek time




                       http://raj-os.blogspot.in/       10
Factors affecting Disk-Scheduling Algorithm


• It is difficult for the operating system to schedule for
  improved rotational latency
   – Because modern disks does not disclose physical location
     of logical blocks

• In modern disks the disk scheduling algorithms are
  built in the disk drive


                         http://raj-os.blogspot.in/             11
Implementation of a Disk-Scheduling Algorithm

• If the OS sends a batch of requests to the controller

• The controller queues them and then schedule them to
  improve
   – Both the SEEK time and the Rotational latency




                      http://raj-os.blogspot.in/          12
Implementation of a Disk-Scheduling Algorithm

• 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


                       http://raj-os.blogspot.in/        13
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

• 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


                         http://raj-os.blogspot.in/                14
Disk Scheduling

• Minimize seek time

• Seek time ≈ Seek distance

Disk bandwidth is the total number of bytes transferred,

The total time between the first request for service and the
  completion of the last transfer




                      http://raj-os.blogspot.in/        15
Disk Scheduling

• Several algorithms exist to schedule the servicing of
  disk I/O requests
• We illustrate them with a request queue (0-199)
   – Tracks 98, 183, 37, 122, 14, 124, 65, 67

   – Head pointer 53




                        http://raj-os.blogspot.in/        16
Illustration shows total head movement of 640 cylinders




                         FCFS
                    http://raj-os.blogspot.in/            17
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


                     http://raj-os.blogspot.in/      18
SSTF




          SSTF
http://raj-os.blogspot.in/   19
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


                         http://raj-os.blogspot.in/                   20
SCAN




           SCAN
http://raj-os.blogspot.in/   21
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




                             http://raj-os.blogspot.in/                      22
C-SCAN




       C-SCAN
http://raj-os.blogspot.in/   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



                        http://raj-os.blogspot.in/             24
C-LOOK




   C-LOOK
http://raj-os.blogspot.in/   25
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


                    http://raj-os.blogspot.in/      26
Selecting a Disk-Scheduling Algorithm

• 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.
                         http://raj-os.blogspot.in/             27
Summary

In this class, you have learnt:

   – Disk Scheduling

   – Various Disk Scheduling algorithms

   – Selection of a particular Disk Scheduling algorithm
   – Summary of Disk Scheduling algorithm


                        http://raj-os.blogspot.in/         28
Frequently Asked Questions


1. How to select a disk scheduling algorithm?

2. List the factors that effect the disk scheduling

    algorithm



                     http://raj-os.blogspot.in/       29
Frequently Asked Questions


3. Compare various scheduling algorithm




                     http://raj-os.blogspot.in/   30
Quiz

• SCAN and C-SCAN perform better for systems that
  place a heavy load on the disk. [T/F]
   TRUE

• If the queue has only one outstanding request all
  scheduling algorithms behave as FCFS [T/F]

   TRUE


                     http://raj-os.blogspot.in/       31
Quiz

• C-LOOK algorithm is a version of C-SCAN [T/F]

   TRUE

• SCAN and C-SCAN perform better for systems that
  place a heavy load on the disk. [T/F]
   TRUE




                   http://raj-os.blogspot.in/       32
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home


                 http://raj-os.blogspot.in/   33

Más contenido relacionado

La actualidad más candente

Primary memory (main memory)
Primary memory (main memory)Primary memory (main memory)
Primary memory (main memory)shah baadshah
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed controlShashank Singh
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptxSanad Bhowmik
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage StructureVimalanathan D
 
Flynns classification
Flynns classificationFlynns classification
Flynns classificationYasir Khan
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Operating system 37 demand paging
Operating system 37 demand pagingOperating system 37 demand paging
Operating system 37 demand pagingVaibhav Khanna
 
Computer Systems Organization
Computer Systems OrganizationComputer Systems Organization
Computer Systems OrganizationLiEdo
 
cpu scheduling
cpu schedulingcpu scheduling
cpu schedulinghashim102
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systemsvampugani
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 

La actualidad más candente (20)

Primary memory (main memory)
Primary memory (main memory)Primary memory (main memory)
Primary memory (main memory)
 
Micro programmed control
Micro programmed  controlMicro programmed  control
Micro programmed control
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
 
Flynns classification
Flynns classificationFlynns classification
Flynns classification
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Cd Rom
Cd RomCd Rom
Cd Rom
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Operating system 37 demand paging
Operating system 37 demand pagingOperating system 37 demand paging
Operating system 37 demand paging
 
Computer Systems Organization
Computer Systems OrganizationComputer Systems Organization
Computer Systems Organization
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
process control block
process control blockprocess control block
process control block
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 

Similar a Disk Scheduling Algorithms Summary

Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49myrajendra
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer ManagementAnshGoyal32
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.comHemant Gautam
 
Disk Scheduling Algorithms
Disk Scheduling AlgorithmsDisk Scheduling Algorithms
Disk Scheduling AlgorithmsAdarsh Kr Sinha
 
Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50myrajendra
 
disk sechduling
disk sechdulingdisk sechduling
disk sechdulinggopi7
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs schedulingmyrajendra
 
IO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performanceIO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performanceAlireza Kamrani
 
I/O buffering & disk scheduling
I/O buffering & disk schedulingI/O buffering & disk scheduling
I/O buffering & disk schedulingRushabh Shah
 

Similar a Disk Scheduling Algorithms Summary (20)

Disk scheduling.49
Disk scheduling.49Disk scheduling.49
Disk scheduling.49
 
Ch9 mass storage systems
Ch9   mass storage systemsCh9   mass storage systems
Ch9 mass storage systems
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.com
 
Disk Scheduling Algorithms
Disk Scheduling AlgorithmsDisk Scheduling Algorithms
Disk Scheduling Algorithms
 
Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50
 
disk sechduling
disk sechdulingdisk sechduling
disk sechduling
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Os7
Os7Os7
Os7
 
18CSC205J-UNIT-5.pptx
18CSC205J-UNIT-5.pptx18CSC205J-UNIT-5.pptx
18CSC205J-UNIT-5.pptx
 
I/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKCI/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKC
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
IO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performanceIO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performance
 
ch10_massSt.pdf
ch10_massSt.pdfch10_massSt.pdf
ch10_massSt.pdf
 
Viknesh
VikneshViknesh
Viknesh
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 
Sucet os module_5_notes
Sucet os module_5_notesSucet os module_5_notes
Sucet os module_5_notes
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
I/O buffering & disk scheduling
I/O buffering & disk schedulingI/O buffering & disk scheduling
I/O buffering & disk scheduling
 
CH10.pdf
CH10.pdfCH10.pdf
CH10.pdf
 

Más de myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Disk Scheduling Algorithms Summary

  • 1. Disk scheduling algorithms summary http://raj-os.blogspot.in/ 1
  • 2. Recap In the last class, you have learnt: • LOOK and C-LOOK Scheduling http://raj-os.blogspot.in/ 2
  • 3. • HOME PREVIOUS TOPIC NEXT • PREVIOUS QUESTION PAPERS FOR OS • CPP TUTORIALS http://raj-os.blogspot.in/ 3
  • 4. Objectives On Completion of this period, you would be able to know • How to select a Disk-Scheduling algorithm • Factors affecting the Disk-Scheduling algorithm • Implementation of Disk-Scheduling algorithm • Summary of disk scheduling algorithm http://raj-os.blogspot.in/ 4
  • 5. Selection of a Disk-Scheduling algorithm Given so many scheduling algorithms how do we choose the best one? • SSTF is common and has a natural appeal because it increases performance over FCFS http://raj-os.blogspot.in/ 5
  • 6. Selection of a Disk-Scheduling Algorithm • SCAN and C-SCAN perform better for systems that place a heavy load on the disk • SCAN and C-SCAN are less likely to cause a starvation problem http://raj-os.blogspot.in/ 6
  • 7. Selection of a Disk-Scheduling Algorithm • For any particular list of requests we can define an optimal order of retrieval • But the computations needed for finding a optimal schedule may not justify the savings over SSTF or SCAN http://raj-os.blogspot.in/ 7
  • 8. Factors affecting Disk-Scheduling Algorithm • With any scheduling algorithm – Performance depends heavily on the number and type of requests • If the queue has only one outstanding request – All scheduling algorithms behave as FCFS http://raj-os.blogspot.in/ 8
  • 9. Factors affecting Disk-Scheduling Algorithm • Requests for disk service can be influenced by the file- allocation method – A program reading contiguously allocated file • Generate several requests that are close together on the disk • Resulting in limited head movement – A program reading linked or indexed allocated file • Generate several requests that include blocks scattered on the disk • Resulting in greater head movement http://raj-os.blogspot.in/ 9
  • 10. Factors affecting Disk-Scheduling Algorithm • The disk Scheduling algorithms considers only the seek distances • For modern disks the rotational latency can be nearly as large as the average seek time http://raj-os.blogspot.in/ 10
  • 11. Factors affecting Disk-Scheduling Algorithm • It is difficult for the operating system to schedule for improved rotational latency – Because modern disks does not disclose physical location of logical blocks • In modern disks the disk scheduling algorithms are built in the disk drive http://raj-os.blogspot.in/ 11
  • 12. Implementation of a Disk-Scheduling Algorithm • If the OS sends a batch of requests to the controller • The controller queues them and then schedule them to improve – Both the SEEK time and the Rotational latency http://raj-os.blogspot.in/ 12
  • 13. Implementation of a Disk-Scheduling Algorithm • 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 http://raj-os.blogspot.in/ 13
  • 14. 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 • 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 http://raj-os.blogspot.in/ 14
  • 15. Disk Scheduling • Minimize seek time • Seek time ≈ Seek distance Disk bandwidth is the total number of bytes transferred, The total time between the first request for service and the completion of the last transfer http://raj-os.blogspot.in/ 15
  • 16. Disk Scheduling • Several algorithms exist to schedule the servicing of disk I/O requests • We illustrate them with a request queue (0-199) – Tracks 98, 183, 37, 122, 14, 124, 65, 67 – Head pointer 53 http://raj-os.blogspot.in/ 16
  • 17. Illustration shows total head movement of 640 cylinders FCFS http://raj-os.blogspot.in/ 17
  • 18. 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 http://raj-os.blogspot.in/ 18
  • 19. SSTF SSTF http://raj-os.blogspot.in/ 19
  • 20. 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 http://raj-os.blogspot.in/ 20
  • 21. SCAN SCAN http://raj-os.blogspot.in/ 21
  • 22. 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 http://raj-os.blogspot.in/ 22
  • 23. C-SCAN C-SCAN http://raj-os.blogspot.in/ 23
  • 24. 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 http://raj-os.blogspot.in/ 24
  • 25. C-LOOK C-LOOK http://raj-os.blogspot.in/ 25
  • 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 http://raj-os.blogspot.in/ 26
  • 27. Selecting a Disk-Scheduling Algorithm • 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. http://raj-os.blogspot.in/ 27
  • 28. Summary In this class, you have learnt: – Disk Scheduling – Various Disk Scheduling algorithms – Selection of a particular Disk Scheduling algorithm – Summary of Disk Scheduling algorithm http://raj-os.blogspot.in/ 28
  • 29. Frequently Asked Questions 1. How to select a disk scheduling algorithm? 2. List the factors that effect the disk scheduling algorithm http://raj-os.blogspot.in/ 29
  • 30. Frequently Asked Questions 3. Compare various scheduling algorithm http://raj-os.blogspot.in/ 30
  • 31. Quiz • SCAN and C-SCAN perform better for systems that place a heavy load on the disk. [T/F] TRUE • If the queue has only one outstanding request all scheduling algorithms behave as FCFS [T/F] TRUE http://raj-os.blogspot.in/ 31
  • 32. Quiz • C-LOOK algorithm is a version of C-SCAN [T/F] TRUE • SCAN and C-SCAN perform better for systems that place a heavy load on the disk. [T/F] TRUE http://raj-os.blogspot.in/ 32
  • 33. Other subject materials • Web designing • Micro processors • C++ tutorials • java home http://raj-os.blogspot.in/ 33