SlideShare a Scribd company logo
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

More Related Content

PPTX
Disk Scheduling Algorithm in Operating System
PDF
Process scheduling (CPU Scheduling)
PPTX
Page replacement algorithms
PPTX
Kernel. Operating System
PPT
Disk scheduling
PPT
Os Threads
PPT
Basics of Operating System
Disk Scheduling Algorithm in Operating System
Process scheduling (CPU Scheduling)
Page replacement algorithms
Kernel. Operating System
Disk scheduling
Os Threads
Basics of Operating System

What's hot (20)

PPTX
Operating System-Memory Management
PPTX
Os unit 3 , process management
PPT
Virtual memory
PDF
System-on-Chip Design, Embedded System Design Challenges
PPTX
Chapter 10 Operating Systems silberschatz
PPT
Multiprocessor Systems
PPTX
Demand paging
PPTX
Superscalar & superpipeline processor
PPT
Thrashing allocation frames.43
PDF
System calls
PDF
Process Scheduling in OS
PDF
RTOS - Real Time Operating Systems
PPTX
Storage management in operating system
PPTX
Deadlocks in operating system
PPTX
Input Output Management in Operating System
PPTX
Cache coherence ppt
PPT
Interprocess communication (IPC) IN O.S
PPT
Parallel processing
PPTX
Direct memory access
PPT
Pipelining
Operating System-Memory Management
Os unit 3 , process management
Virtual memory
System-on-Chip Design, Embedded System Design Challenges
Chapter 10 Operating Systems silberschatz
Multiprocessor Systems
Demand paging
Superscalar & superpipeline processor
Thrashing allocation frames.43
System calls
Process Scheduling in OS
RTOS - Real Time Operating Systems
Storage management in operating system
Deadlocks in operating system
Input Output Management in Operating System
Cache coherence ppt
Interprocess communication (IPC) IN O.S
Parallel processing
Direct memory access
Pipelining
Ad

Similar to Disk scheduling algorithm.52 (20)

PPT
Disk scheduling.49
PDF
Ch9 mass storage systems
PPT
Disk scheduling
PPT
Disk Scheduling Algorithms Mar 30 2024.ppt
PPT
Disk Management through the Computer Management
PPT
Disk scheduling geekssay.com
PPT
Mass storage systems presentation operating systems
PPT
Disk Scheduling Algorithms
PPT
Sstf scheduling.50
PDF
disk sechduling
PPT
Operating Systems
PPTX
FILE SYSTEMS AND ORGANISATION STRUCTURE.pptx
PPTX
18CSC205J Operating Systems unit 5 - new.pptx
PPTX
18CSC205J-UNIT-5.pptx
PPT
Disk scheduling algorithms
PPTX
18CSC205J Operating Systemkooks-Unit-5.pptx
PPT
CH13-OS.PPTdfjhfgjkghkc kjbhkyuikgkmbv mh
PPTX
I/O structure slide by Rajalakshmi SKC
PPT
Fcfs scheduling
Disk scheduling.49
Ch9 mass storage systems
Disk scheduling
Disk Scheduling Algorithms Mar 30 2024.ppt
Disk Management through the Computer Management
Disk scheduling geekssay.com
Mass storage systems presentation operating systems
Disk Scheduling Algorithms
Sstf scheduling.50
disk sechduling
Operating Systems
FILE SYSTEMS AND ORGANISATION STRUCTURE.pptx
18CSC205J Operating Systems unit 5 - new.pptx
18CSC205J-UNIT-5.pptx
Disk scheduling algorithms
18CSC205J Operating Systemkooks-Unit-5.pptx
CH13-OS.PPTdfjhfgjkghkc kjbhkyuikgkmbv mh
I/O structure slide by Rajalakshmi SKC
Fcfs scheduling
Ad

More from myrajendra (20)

PPT
Fundamentals
PPT
Data type
PPTX
Hibernate example1
PPTX
Jdbc workflow
PPTX
2 jdbc drivers
PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Dao example
PPTX
Sessionex1
PPTX
Internal
PPTX
3. elements
PPTX
2. attributes
PPTX
1 introduction to html
PPTX
Headings
PPTX
Forms
PPT
PPTX
Views
PPTX
Views
PPTX
Views
PPT
Starting jdbc
Fundamentals
Data type
Hibernate example1
Jdbc workflow
2 jdbc drivers
3 jdbc api
4 jdbc step1
Dao example
Sessionex1
Internal
3. elements
2. attributes
1 introduction to html
Headings
Forms
Views
Views
Views
Starting jdbc

Disk scheduling algorithm.52

  • 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