SlideShare a Scribd company logo
1 of 25
A. Ghanaatpishe, H. Mobasher, H. Mozaffari
Information Storage and Retrieval
April 21, 2014
Disk scheduling algorithms
 Introduction
 Various Scheduling algorithms
 FCFS
 SSTF
 SCAN
 C-SCAN
 N-Step-SCAN, FSCAN
 LOOK
 C-LOOK
 Comparison of Disk Scheduling Algorithms
 Conclusion
Overview
 What is disk scheduling?
Servicing the disk I/O requests
 Why disk Scheduling?
Use hardware efficiently
 Disk scheduling includes
Fast access time (seek time+ rotational latency)
Introduction
 If desired disk drive is available, request is served
immediately.
 If busy, new request for service will be placed in the queue
of pending requests. When one request is completed, the
OS has to choose which pending request to service next.
I/O requests, OS handling
 To read or write, the disk head must be positioned at the
desired track and at the beginning of the desired sector
 Seek time
Time it takes to position the head at the desired track
 Rotational delay or rotational latency
Time its takes for the beginning of the sector to reach the head
 Data transfer time
Data transfer occurs as the sector moves under the head
Disk Performance Parameters
 Seek time is the reason for differences in performance
 For a single disk there will be a number of I/O requests
 If requests are selected randomly, we will poor
performance
Disk Scheduling Policies
 Work Queue: 23, 89, 132, 42, 187
 There are 200 cylinders numbered from 0 – 199.
 The disk head stars at number 100.
Example
 Process request sequentially.
 Fair to all processes, no starvation.
 Approaches random scheduling in performance if there
are many processes.
First come, first serve(FCFS)
FCFS Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
23 − 100 + 89 − 23 + 132 − 89 + 42 − 132 + 187 − 42 = 421
 Select the disk I/O request that requires the least
movement of the disk arm from its current position.
 Always choose the minimum Seek time.
 Starvation is possible; stay in one area of the disk.
 If very busy switching directions, slows things down.
 Not the most optimal.
Shortest Service Time First (SSTF)
SSTF Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
89 − 100 + 132 − 89 + 187 − 132 + 42 − 187 + 23 − 42 = 263
 Arm moves in one direction only, satisfying all outstanding
requests until it reaches the last track in that direction
 Direction is reversed
 Sometimes called the elevator algorithm.
SCAN
SCAN Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
89 − 100 + 42 − 89 + 23 − 42 + 0 − 23 + 132 − 0 + 187 − 132 = 287
 Restricts scanning to one direction only
 When the last track has been visited in one direction, the
arm is returned to the opposite end of the disk and the
scan begins again
C-SCAN
C-SCAN Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
89 − 100 + 42 − 89 + 23 − 42 + 0 − 23 + 199 − 0 + 187 − 199 + 132 − 189 = 368
 Segments the disk request queue into sub queues of
length N.
 Sub queues are processed one at a time, using SCAN.
 New requests added to other queue when queue is
processed.
N-step-SCAN
 Two queues
 One queue is empty for new requests
FSCAN
 The LOOK algorithm is the same as the SCAN algorithm in
that it also honors requests on both sweep direction of the
disk head.
 The arm goes only as far as final requests in each direction
and then reverses direction without going all the way to
the end.
LOOK
LOOK Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
89 − 100 + 42 − 89 + 23 − 42 + 132 − 23 + 187 − 132 = 241
 This is just an enhanced version of C-SCAN.
 In this, the scanning doesn't go past the last request in the
direction that it is moving. It too jumps to the other end
but not all the way to the end, Just to the furthest request.
C-LOOK
C-LOOK Solution
Work Queue: 23, 89, 132, 42, 187
Total seek length:
89 − 100 + 42 − 89 + 23 − 42 + 187 − 23 + 132 − 187 = 296
FCFS SSTF SCAN C-SCAN LOOK C-LOOK
421 263 287 368 241 296
Total seek
length
84.2 52.6 57.4 73.6 48.2 59.2
Average
seek
length
Comparison of Disk Scheduling Algorithms
 Performance depends on number of requests.
 SCAN, C-SCAN for systems that place a heavy load on the
disk, as they are less likely to cause starvation.
 Default algorithms, SSTF or LOOK
Conclusion
 Operating Systems. William Stalling, 7th edition.
 Example of Disk Scheduling Algorithms:
http://www2.cs.uregina.ca/~hamilton/courses/330/notes/io/node8.html
 Disk Scheduling, Vaibhav Kumar Gupta
http://www4.comp.polyu.edu.hk/~csajaykr/myhome/teaching/eel358/ds.pdf
 Operating System Concepts. Greg Gagne, Peter Baer Galvin, and
Abraham Silberschatz, 8th edition.
References
Questions & Discussion

More Related Content

What's hot

ERP on School Management System
ERP on School Management SystemERP on School Management System
ERP on School Management SystemAmit Gandhi
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Threadjeetendra mandal
 
Casino game project based on c++
Casino  game  project based on c++Casino  game  project based on c++
Casino game project based on c++Niteen Balpande
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
5 assessment instrument evidence_ tos_ written t_est_etc
5  assessment instrument  evidence_ tos_ written t_est_etc5  assessment instrument  evidence_ tos_ written t_est_etc
5 assessment instrument evidence_ tos_ written t_est_etcMCabz1
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk managementSiva Priya
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating Systemsubhsikha
 
Synopsis on billing system
Synopsis on billing systemSynopsis on billing system
Synopsis on billing systemAlok Sharma
 
Online Voting System Project File
Online Voting System Project FileOnline Voting System Project File
Online Voting System Project FileNitin Bhasin
 
C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for universitySheikh Monirul Hasan
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsUsman Sait
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XETemesgen Molla
 
parallelization strategy
parallelization strategyparallelization strategy
parallelization strategyR. M.
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++ Prince Kumar
 
Airline reservation system
Airline reservation systemAirline reservation system
Airline reservation systemdwitigajab
 

What's hot (20)

C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
ERP on School Management System
ERP on School Management SystemERP on School Management System
ERP on School Management System
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
 
Casino game project based on c++
Casino  game  project based on c++Casino  game  project based on c++
Casino game project based on c++
 
Disk Management
Disk ManagementDisk Management
Disk Management
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
5 assessment instrument evidence_ tos_ written t_est_etc
5  assessment instrument  evidence_ tos_ written t_est_etc5  assessment instrument  evidence_ tos_ written t_est_etc
5 assessment instrument evidence_ tos_ written t_est_etc
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk management
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Synopsis on billing system
Synopsis on billing systemSynopsis on billing system
Synopsis on billing system
 
Online Voting System Project File
Online Voting System Project FileOnline Voting System Project File
Online Voting System Project File
 
C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for university
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & Snapshots
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XE
 
Weather Now
Weather NowWeather Now
Weather Now
 
parallelization strategy
parallelization strategyparallelization strategy
parallelization strategy
 
Weather Display app
Weather Display appWeather Display app
Weather Display app
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++
 
Airline reservation system
Airline reservation systemAirline reservation system
Airline reservation system
 

Viewers also liked (13)

CodeIgniter
CodeIgniterCodeIgniter
CodeIgniter
 
Desarrollo de la unidad didáctica
Desarrollo de la unidad didácticaDesarrollo de la unidad didáctica
Desarrollo de la unidad didáctica
 
Shive
ShiveShive
Shive
 
Live API Documentation
Live API Documentation Live API Documentation
Live API Documentation
 
WMA Risk Survey 2016
WMA Risk Survey 2016WMA Risk Survey 2016
WMA Risk Survey 2016
 
UCloud
UCloudUCloud
UCloud
 
Database
DatabaseDatabase
Database
 
Intimacy
IntimacyIntimacy
Intimacy
 
Makalah psikologi
Makalah psikologiMakalah psikologi
Makalah psikologi
 
Presentation
PresentationPresentation
Presentation
 
Association Rule Mining in Social Network Data
Association Rule Mining in Social Network DataAssociation Rule Mining in Social Network Data
Association Rule Mining in Social Network Data
 
Advanced Java
Advanced JavaAdvanced Java
Advanced Java
 
Illustration and Graphic Design Portfolio
Illustration and Graphic Design PortfolioIllustration and Graphic Design Portfolio
Illustration and Graphic Design Portfolio
 

Similar to ISR (20)

Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 
Os(18 cs43) module5
Os(18 cs43) module5Os(18 cs43) module5
Os(18 cs43) module5
 
Sucet os module_5_notes
Sucet os module_5_notesSucet os module_5_notes
Sucet os module_5_notes
 
I/O buffering & disk scheduling
I/O buffering & disk schedulingI/O buffering & disk scheduling
I/O buffering & disk scheduling
 
Chapter 12 Model Answers
Chapter 12 Model AnswersChapter 12 Model Answers
Chapter 12 Model Answers
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
 
Disk Scheduling In Operating System.pptx
Disk Scheduling In Operating System.pptxDisk Scheduling In Operating System.pptx
Disk Scheduling In Operating System.pptx
 
Device Management
Device ManagementDevice Management
Device Management
 
Disk Scheduling Algorithms
Disk Scheduling AlgorithmsDisk Scheduling Algorithms
Disk Scheduling Algorithms
 
Disk Management
Disk ManagementDisk Management
Disk Management
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
Disk structure
Disk structureDisk structure
Disk structure
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Operating system
Operating systemOperating system
Operating system
 
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
 

ISR

  • 1. A. Ghanaatpishe, H. Mobasher, H. Mozaffari Information Storage and Retrieval April 21, 2014 Disk scheduling algorithms
  • 2.  Introduction  Various Scheduling algorithms  FCFS  SSTF  SCAN  C-SCAN  N-Step-SCAN, FSCAN  LOOK  C-LOOK  Comparison of Disk Scheduling Algorithms  Conclusion Overview
  • 3.  What is disk scheduling? Servicing the disk I/O requests  Why disk Scheduling? Use hardware efficiently  Disk scheduling includes Fast access time (seek time+ rotational latency) Introduction
  • 4.  If desired disk drive is available, request is served immediately.  If busy, new request for service will be placed in the queue of pending requests. When one request is completed, the OS has to choose which pending request to service next. I/O requests, OS handling
  • 5.  To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector  Seek time Time it takes to position the head at the desired track  Rotational delay or rotational latency Time its takes for the beginning of the sector to reach the head  Data transfer time Data transfer occurs as the sector moves under the head Disk Performance Parameters
  • 6.  Seek time is the reason for differences in performance  For a single disk there will be a number of I/O requests  If requests are selected randomly, we will poor performance Disk Scheduling Policies
  • 7.  Work Queue: 23, 89, 132, 42, 187  There are 200 cylinders numbered from 0 – 199.  The disk head stars at number 100. Example
  • 8.  Process request sequentially.  Fair to all processes, no starvation.  Approaches random scheduling in performance if there are many processes. First come, first serve(FCFS)
  • 9. FCFS Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 23 − 100 + 89 − 23 + 132 − 89 + 42 − 132 + 187 − 42 = 421
  • 10.  Select the disk I/O request that requires the least movement of the disk arm from its current position.  Always choose the minimum Seek time.  Starvation is possible; stay in one area of the disk.  If very busy switching directions, slows things down.  Not the most optimal. Shortest Service Time First (SSTF)
  • 11. SSTF Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 89 − 100 + 132 − 89 + 187 − 132 + 42 − 187 + 23 − 42 = 263
  • 12.  Arm moves in one direction only, satisfying all outstanding requests until it reaches the last track in that direction  Direction is reversed  Sometimes called the elevator algorithm. SCAN
  • 13. SCAN Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 89 − 100 + 42 − 89 + 23 − 42 + 0 − 23 + 132 − 0 + 187 − 132 = 287
  • 14.  Restricts scanning to one direction only  When the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again C-SCAN
  • 15. C-SCAN Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 89 − 100 + 42 − 89 + 23 − 42 + 0 − 23 + 199 − 0 + 187 − 199 + 132 − 189 = 368
  • 16.  Segments the disk request queue into sub queues of length N.  Sub queues are processed one at a time, using SCAN.  New requests added to other queue when queue is processed. N-step-SCAN
  • 17.  Two queues  One queue is empty for new requests FSCAN
  • 18.  The LOOK algorithm is the same as the SCAN algorithm in that it also honors requests on both sweep direction of the disk head.  The arm goes only as far as final requests in each direction and then reverses direction without going all the way to the end. LOOK
  • 19. LOOK Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 89 − 100 + 42 − 89 + 23 − 42 + 132 − 23 + 187 − 132 = 241
  • 20.  This is just an enhanced version of C-SCAN.  In this, the scanning doesn't go past the last request in the direction that it is moving. It too jumps to the other end but not all the way to the end, Just to the furthest request. C-LOOK
  • 21. C-LOOK Solution Work Queue: 23, 89, 132, 42, 187 Total seek length: 89 − 100 + 42 − 89 + 23 − 42 + 187 − 23 + 132 − 187 = 296
  • 22. FCFS SSTF SCAN C-SCAN LOOK C-LOOK 421 263 287 368 241 296 Total seek length 84.2 52.6 57.4 73.6 48.2 59.2 Average seek length Comparison of Disk Scheduling Algorithms
  • 23.  Performance depends on number of requests.  SCAN, C-SCAN for systems that place a heavy load on the disk, as they are less likely to cause starvation.  Default algorithms, SSTF or LOOK Conclusion
  • 24.  Operating Systems. William Stalling, 7th edition.  Example of Disk Scheduling Algorithms: http://www2.cs.uregina.ca/~hamilton/courses/330/notes/io/node8.html  Disk Scheduling, Vaibhav Kumar Gupta http://www4.comp.polyu.edu.hk/~csajaykr/myhome/teaching/eel358/ds.pdf  Operating System Concepts. Greg Gagne, Peter Baer Galvin, and Abraham Silberschatz, 8th edition. References