SlideShare a Scribd company logo
1 of 17
Al_Nahrain University
COLLEGE OF INFORMATION
ENGINEERING
SYSTEM DEPARTMENT
Disk Scheduling Algorithms
ALI Jawad
Abstract
This presentation starts from the structure of a disk ,the hardware activities involved in the data
retrieval from direct attached storage device and Working Principle, then introduces and
compares multiple Disk Scheduling algorithms such as.
 First Come First Serve (FCFS).
 Shortest Seek Time First (SSTF).
 SCAN Scheduling Algorithm.
 LOOK Scheduling Algorithm.
There are others algorithms such as a
Circular SCAN (C-SCAN) Algorithm
and C-LOOK Scheduling Algorithm
I will take it in order these four algorithms to show the differences between these algorithms,
serial examples are provided and concluded with analysis in the end.
ALI Jawad
The disk consists of
 1- A platter, made of metal or plastic.
 2- a magnet coating on it.
 3- Flat circular shape (cylinder).
 4- the spindle keeps the platters in position.
 5- the read/write arm controls the movement of the read/write heads.
Disk Structure
ALI Jawad
Working Principle
 The drive motor spins disk at high speed.
 The read/write arm swings read/write head
back and forth across platter.
 Central spindle allows platter to rotate at high
speed.
 Magnetic platter is stored Information on the
track in binary form.
ALI Jawad
Disk Scheduling Algorithms
 Disk scheduling algorithms are used to allocate the services to the I/O
requests on the disk. Since seeking disk requests is time consuming, disk
scheduling algorithms try to minimize this latency.
 The objective of using these algorithms is keeping Head movements to
the amount as possible. The less the head to move, the faster the seek
time will be. To see how it works, the different disk scheduling algorithms
will be discussed and examples are also provided for better understanding
on these different algorithms.
ALI Jawad
1-First Come First Serve (FCFS)
 It is the simplest form of disk scheduling algorithms. The I/O requests are served or
processes according to their arrival. The request arrives first will be accessed and
served first.
Example:
Given the following track requests in the disk queue, compute for the Total Head
Movement2 (THM) of the read/write head:
95, 180, 34, 119, 11, 123, 62, 64
Consider that the read/write head is positioned at location 50. Prior to this track
location 199 was serviced. Show the total head movement for a 200 track disk (0-199).
ALI Jawad
Solution:
Total Head Movement Computation:
(THM) = (180 - 50) + (180-34) + (119-34) +
(119-11) + (123-11) + (123-62) + (64-62)
= 130 + 146 + 85 + 108 + 112 + 61 + 2
(THM) = 644 tracks
Assuming a seek rate of 5 milliseconds is
given, we compute for the seek time using
the formula:
Seek Time = THM * Seek rate = 644 * 5 ms
Seek Time = 3,220 ms
50
95
180
34
119
11
123
62
64
0
20
40
60
80
100
120
140
160
180
200
0 1 2 3 4 5 6 7 8 9
Time
Disk Scheduling Algorithms : FCFS
95, 180, 34, 119, 11, 123, 62, 64
ALI Jawad
First Come First Serve (FCFS)
Conclusion
There are some requests that are far from the current location of the R/W head which causes the
access arm to travel from innermost to the outermost tracks of the disk or vice versa.
In this example, it had a total of 644 tracks and a seek time of 3,220 milliseconds. Based on the
result, this algorithm produced higher seek rate since it follows the arrival of the track requests.
ALI Jawad
2-Shortest Seek Time First (SSTF)
This algorithm is based on the idea that the R/W head should proceed to the track that
is closest to its current position.
The process would continue until all the track requests are taken care of.
Using the same sets of example in FCFS the solution are as follows:
Example:
Given the following track requests in the disk queue, compute for the Total Head
Movement2 (THM) of the read/write head:
95, 180, 34, 119, 11, 123, 62, 64
Consider that the read/write head is positioned at location 50. Prior to this track
location 199 was serviced. Show the total head movement for a 200 track disk (0-199).
ALI Jawad
Solution:
 (THM) = 12+2+30+23+84+24+4+57 =
 (THM) = 236 tracks
 Seek Time = THM * Seek rate = 236 * 5ms
 Seek Time = 1,180 ms
Conclusion
In this algorithm, request is serviced according to
the next shortest distance. Starting at 50, the next
shortest distance would be 62 instead of 34 since it
is only 12 tracks away from 62 and 16 tracks away
from 34. The process would continue up to the last
track request. There are a total of 236 tracks and a
seek time of 1,180 ms, which seems to be a better
service compared with FCFS
0
20
40
60
80
100
120
140
160
180
200
0 1 2 3 4 5 6 7 8 9
Time
Disk Scheduling Algorithm : SSTF
95, 180, 34, 119, 11, 123, 62, 64
ALI Jawad
 This algorithm is performed by moving the R/W head back-and-forth to
the innermost and outermost track. As it scans the tracks from end to end
Using the same sets of example In FCFS the solution are as follows:
Example:
Given the following track requests in the disk queue, compute for the Total
Head Movement2 (THM) of the read/write head:
95, 180, 34, 119, 11, 123, 62, 64
3-SCAN Scheduling Algorithm
ALI Jawad
Solution:
 (THM) = (50-0) + (180-0) = 50 + 180
 (THM) = 230
 Seek Time = THM * Seek rate = 230 * 5ms
 Seek Time = 1,150 ms
Conclusion
This algorithm works like an elevator does. In
the algorithm example, it scans down towards
the nearest end and when it reached the
bottom it scans up servicing the requests that
it did not get going down. If a request comes
in after it has been scanned, it will not be
serviced until the process comes back down
or moves back up. This process moved a total
of 230 tracks and a seek time of 1,150. This is
optimal than the previous algorithm.
50
34
11
0
199
180
123 119
95
64 62
0
50
100
150
200
250
0 2 4 6 8 10 12
Time
Disk Scheduling Algorithms : SCAN
95, 180, 34, 119, 11, 123, 62, 64
ALI Jawad
4-LOOK Scheduling Algorithm
 This algorithm is similar to SCAN algorithm except for the end-to-end
reach of each sweep. The R/W head is only tasked to go the farthest
location in need of servicing. This is also a directional algorithm, as soon as
it is done with the last request in one direction it then sweeps in the other
direction.
Using the same sets of example in FCFS the solution are as follows:
Example:
Given the following track requests in the disk queue, compute for the Total
Head Movement2 (THM) of the read/write head:
95, 180, 34, 119, 11, 123, 62, 64
ALI Jawad
Solution:
 (THM) = (50-11) + (180-11) = 39 + 169
 (THM) = 208 tracks
 Seek Time = THM * Seek rate = 208 * 5ms
 Seek Time = 1,040 ms
Conclusion
This algorithm has a result of 208 tracks and a
seek rate of 1,040 milliseconds. This algorithm is
better than the previous algorithm.
50
34
11
180
123
119
95
64
62
0
20
40
60
80
100
120
140
160
180
200
0 1 2 3 4 5 6 7 8 9
Time
Disk Scheduling Algorithm : look
95, 180, 34, 119, 11, 123, 62, 64
ALI Jawad
Summary
Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk and improve its
performance. Different qualities exists on these algorithms based on the given examples and computations. Several
disadvantages also occur on these different algorithm and these are:
* Before the analysis we must know when selecting a Disk Scheduling algorithm, performance depends on the number and
types of requests.
 The FCFS performs operations in order requested. No reordering of work queue since it processed disk requests
according to its arrival. There is no starvation and all the requests are serviced but it doesn’t provide fastest
service.
 The Shortest Seek Time First (SSTF) selects the disk I/O request that requires the least movement of the disk
access arm from its current position regardless of direction. It also reduces the seek time compared to FCFS but in
this algorithm, I/O requests at the edges of the disk surface may get starved.
 The SCAN algorithm go from the outside to the inside servicing requests and then back from the outside to the
inside servicing requests. It also reduces variance compared to SSTF.
 In LOOK scheduling algorithm, the arm goes only as far as the final request in each direction. The direction
reverses immediately, without going all the way to the end of the disk.
ALI Jawad
ALI Jawad

More Related Content

What's hot

Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architectureArpan Baishya
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Schedulingsathish sak
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxLECO9
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin schedulingRaghav S
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs schedulingmyrajendra
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)Dinesh Modak
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzGiulianoRanauro
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)ritu98
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipeliningMazin Alwaaly
 
41 page replacement fifo
41 page replacement fifo41 page replacement fifo
41 page replacement fifomyrajendra
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processingvishal choudhary
 

What's hot (20)

Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architecture
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatz
 
Memory management
Memory managementMemory management
Memory management
 
Cache memory
Cache memoryCache memory
Cache memory
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
System calls
System callsSystem calls
System calls
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
41 page replacement fifo
41 page replacement fifo41 page replacement fifo
41 page replacement fifo
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Semaphores
SemaphoresSemaphores
Semaphores
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processing
 

Similar to Disk Scheduling Algorithms

Similar to Disk Scheduling Algorithms (20)

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
 
Gantt chat for cylenders
Gantt chat for cylendersGantt chat for cylenders
Gantt chat for cylenders
 
I/O buffering & disk scheduling
I/O buffering & disk schedulingI/O buffering & disk scheduling
I/O buffering & disk scheduling
 
I/O Management
I/O ManagementI/O Management
I/O Management
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Explained Disk Scheduling Algo ...
Explained Disk Scheduling Algo ...Explained Disk Scheduling Algo ...
Explained Disk Scheduling Algo ...
 
Placement AlgorithmIt decides which program to load into the memo.pdf
Placement AlgorithmIt decides which program to load into the memo.pdfPlacement AlgorithmIt decides which program to load into the memo.pdf
Placement AlgorithmIt decides which program to load into the memo.pdf
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)
 
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
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
 
Os(18 cs43) module5
Os(18 cs43) module5Os(18 cs43) module5
Os(18 cs43) module5
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
Operating system
Operating systemOperating system
Operating system
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 

Disk Scheduling Algorithms

  • 1. Al_Nahrain University COLLEGE OF INFORMATION ENGINEERING SYSTEM DEPARTMENT
  • 3. Abstract This presentation starts from the structure of a disk ,the hardware activities involved in the data retrieval from direct attached storage device and Working Principle, then introduces and compares multiple Disk Scheduling algorithms such as.  First Come First Serve (FCFS).  Shortest Seek Time First (SSTF).  SCAN Scheduling Algorithm.  LOOK Scheduling Algorithm. There are others algorithms such as a Circular SCAN (C-SCAN) Algorithm and C-LOOK Scheduling Algorithm I will take it in order these four algorithms to show the differences between these algorithms, serial examples are provided and concluded with analysis in the end. ALI Jawad
  • 4. The disk consists of  1- A platter, made of metal or plastic.  2- a magnet coating on it.  3- Flat circular shape (cylinder).  4- the spindle keeps the platters in position.  5- the read/write arm controls the movement of the read/write heads. Disk Structure ALI Jawad
  • 5. Working Principle  The drive motor spins disk at high speed.  The read/write arm swings read/write head back and forth across platter.  Central spindle allows platter to rotate at high speed.  Magnetic platter is stored Information on the track in binary form. ALI Jawad
  • 6. Disk Scheduling Algorithms  Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk. Since seeking disk requests is time consuming, disk scheduling algorithms try to minimize this latency.  The objective of using these algorithms is keeping Head movements to the amount as possible. The less the head to move, the faster the seek time will be. To see how it works, the different disk scheduling algorithms will be discussed and examples are also provided for better understanding on these different algorithms. ALI Jawad
  • 7. 1-First Come First Serve (FCFS)  It is the simplest form of disk scheduling algorithms. The I/O requests are served or processes according to their arrival. The request arrives first will be accessed and served first. Example: Given the following track requests in the disk queue, compute for the Total Head Movement2 (THM) of the read/write head: 95, 180, 34, 119, 11, 123, 62, 64 Consider that the read/write head is positioned at location 50. Prior to this track location 199 was serviced. Show the total head movement for a 200 track disk (0-199). ALI Jawad
  • 8. Solution: Total Head Movement Computation: (THM) = (180 - 50) + (180-34) + (119-34) + (119-11) + (123-11) + (123-62) + (64-62) = 130 + 146 + 85 + 108 + 112 + 61 + 2 (THM) = 644 tracks Assuming a seek rate of 5 milliseconds is given, we compute for the seek time using the formula: Seek Time = THM * Seek rate = 644 * 5 ms Seek Time = 3,220 ms 50 95 180 34 119 11 123 62 64 0 20 40 60 80 100 120 140 160 180 200 0 1 2 3 4 5 6 7 8 9 Time Disk Scheduling Algorithms : FCFS 95, 180, 34, 119, 11, 123, 62, 64 ALI Jawad
  • 9. First Come First Serve (FCFS) Conclusion There are some requests that are far from the current location of the R/W head which causes the access arm to travel from innermost to the outermost tracks of the disk or vice versa. In this example, it had a total of 644 tracks and a seek time of 3,220 milliseconds. Based on the result, this algorithm produced higher seek rate since it follows the arrival of the track requests. ALI Jawad
  • 10. 2-Shortest Seek Time First (SSTF) This algorithm is based on the idea that the R/W head should proceed to the track that is closest to its current position. The process would continue until all the track requests are taken care of. Using the same sets of example in FCFS the solution are as follows: Example: Given the following track requests in the disk queue, compute for the Total Head Movement2 (THM) of the read/write head: 95, 180, 34, 119, 11, 123, 62, 64 Consider that the read/write head is positioned at location 50. Prior to this track location 199 was serviced. Show the total head movement for a 200 track disk (0-199). ALI Jawad
  • 11. Solution:  (THM) = 12+2+30+23+84+24+4+57 =  (THM) = 236 tracks  Seek Time = THM * Seek rate = 236 * 5ms  Seek Time = 1,180 ms Conclusion In this algorithm, request is serviced according to the next shortest distance. Starting at 50, the next shortest distance would be 62 instead of 34 since it is only 12 tracks away from 62 and 16 tracks away from 34. The process would continue up to the last track request. There are a total of 236 tracks and a seek time of 1,180 ms, which seems to be a better service compared with FCFS 0 20 40 60 80 100 120 140 160 180 200 0 1 2 3 4 5 6 7 8 9 Time Disk Scheduling Algorithm : SSTF 95, 180, 34, 119, 11, 123, 62, 64 ALI Jawad
  • 12.  This algorithm is performed by moving the R/W head back-and-forth to the innermost and outermost track. As it scans the tracks from end to end Using the same sets of example In FCFS the solution are as follows: Example: Given the following track requests in the disk queue, compute for the Total Head Movement2 (THM) of the read/write head: 95, 180, 34, 119, 11, 123, 62, 64 3-SCAN Scheduling Algorithm ALI Jawad
  • 13. Solution:  (THM) = (50-0) + (180-0) = 50 + 180  (THM) = 230  Seek Time = THM * Seek rate = 230 * 5ms  Seek Time = 1,150 ms Conclusion This algorithm works like an elevator does. In the algorithm example, it scans down towards the nearest end and when it reached the bottom it scans up servicing the requests that it did not get going down. If a request comes in after it has been scanned, it will not be serviced until the process comes back down or moves back up. This process moved a total of 230 tracks and a seek time of 1,150. This is optimal than the previous algorithm. 50 34 11 0 199 180 123 119 95 64 62 0 50 100 150 200 250 0 2 4 6 8 10 12 Time Disk Scheduling Algorithms : SCAN 95, 180, 34, 119, 11, 123, 62, 64 ALI Jawad
  • 14. 4-LOOK Scheduling Algorithm  This algorithm is similar to SCAN algorithm except for the end-to-end reach of each sweep. The R/W head is only tasked to go the farthest location in need of servicing. This is also a directional algorithm, as soon as it is done with the last request in one direction it then sweeps in the other direction. Using the same sets of example in FCFS the solution are as follows: Example: Given the following track requests in the disk queue, compute for the Total Head Movement2 (THM) of the read/write head: 95, 180, 34, 119, 11, 123, 62, 64 ALI Jawad
  • 15. Solution:  (THM) = (50-11) + (180-11) = 39 + 169  (THM) = 208 tracks  Seek Time = THM * Seek rate = 208 * 5ms  Seek Time = 1,040 ms Conclusion This algorithm has a result of 208 tracks and a seek rate of 1,040 milliseconds. This algorithm is better than the previous algorithm. 50 34 11 180 123 119 95 64 62 0 20 40 60 80 100 120 140 160 180 200 0 1 2 3 4 5 6 7 8 9 Time Disk Scheduling Algorithm : look 95, 180, 34, 119, 11, 123, 62, 64 ALI Jawad
  • 16. Summary Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk and improve its performance. Different qualities exists on these algorithms based on the given examples and computations. Several disadvantages also occur on these different algorithm and these are: * Before the analysis we must know when selecting a Disk Scheduling algorithm, performance depends on the number and types of requests.  The FCFS performs operations in order requested. No reordering of work queue since it processed disk requests according to its arrival. There is no starvation and all the requests are serviced but it doesn’t provide fastest service.  The Shortest Seek Time First (SSTF) selects the disk I/O request that requires the least movement of the disk access arm from its current position regardless of direction. It also reduces the seek time compared to FCFS but in this algorithm, I/O requests at the edges of the disk surface may get starved.  The SCAN algorithm go from the outside to the inside servicing requests and then back from the outside to the inside servicing requests. It also reduces variance compared to SSTF.  In LOOK scheduling algorithm, the arm goes only as far as the final request in each direction. The direction reverses immediately, without going all the way to the end of the disk. ALI Jawad