Chapter6 Diskscheduling
Chapter6 Diskscheduling
I/O Management
Moving-head Disk Mechanism
• Disk scheduling is done by operating systems to schedule I/O
requests arriving for the disk. Disk scheduling is also known as I/O
scheduling.
• Multiple I/O requests may arrive by different processes and only one
I/O request can be served at a time by the disk controller. Thus other
I/O requests need to wait in the waiting queue and need to be
scheduled.
• Two or more request may be far from each other so can result in
greater disk arm movement.
• Hard drives are one of the slowest parts of the computer system and
thus need to be accessed in an efficient manner.
• There are many Disk Scheduling Algorithms but before discussing them
let’s have a quick look at some of the important terms:
• Seek Time:Seek time is the time taken to locate the disk arm to a
specified track where the data is to be read or write. So the disk
scheduling algorithm that gives minimum average seek time is better.
• Transfer Time: Transfer time is the time to transfer the data. It depends
on the rotating speed of the disk and number of bytes to be
transferred.
Seek Sequence is
41
34
11
0
60
79
92
114
176
• The following chart shows the sequence in which requested tracks
are serviced using SCAN.
= 226
• CSCAN: Head start at one end of the disk and
moves towards the other end servicing requests
in between and reach other end and then
direction of the head is reversed and head
reaches first end without satisfying any request.
Advantages
• Provides uniform waiting time.
• Better response time.
Disadvantage
• More seeks movements compared to simple
SCAN
Advantages
• Simple to understand and implement.
• No starvation(bounded waiting).
• Low variance and average waiting time.
Disadvantage
• Long waiting for locations just visited by head.
• Unnecessary moves till the end of the disk
there is no request.
Input: Request sequence = {176, 79, 34, 60, 92, 11, 41, 114}
Initial head position = 50
Output:
= (60-50)+(79-60)+(92-79) +(114-92)+
(176-114)+(199-176)+(199-0) +(11-0)+
(34-11)+(41-34)
= 389
• LOOK: It is same as SCAN algorithm but
instead of going till last track we will go last
request and then change direction.
• Advantages
• Better performance compared to SCAN.
• Should be used in case of less load.
Input: Request sequence =
{176, 79, 34, 60, 92, 11, 41, 114}
Initial head position = 50
Direction = right (We are moving from left to right)
Output: Initial position of head: 50
Total number of seek operations = 291
Seek Sequence is
60
79
92
114
176
41
34
11
Therefore, the total seek count is calculated as:
= (60-50)+(79-60)+(92-79) +(114-92)+(176-114) +(176-41)+(41-
34)+(34-11)
CLOOK: It takes the advantages of both C-SCAN and
look algorithm.
• Will satisfy request only in one direction.
• Will go till last request and return but not till last
track.
Advantages
• More uniform time compared to look.
• More efficient (less moves)compared to C-SCAN .
Disadvantages
More overload in calculation.
Should not be used incase of more load.
• Input:
Request sequence = {176, 79, 34, 60, 92, 11, 41, 114}
Initial head position = 50
Direction = right (Moving from left to right)
Output:
Initial position of head: 50
Total number of seek operations = 156
Seek Sequence is
60
79
92
114
176
11
34
41
• The following chart shows the sequence in which
requested tracks are serviced using C-LOOK.
Therefore, the total seek count = (60 – 50) + (79 – 60) + (92 –
79) + (114 – 92) + (176 – 114) + (176 – 11) + (34 – 11) + (41 –
34) = 321
FCFS Example 2
Request sequence = {176, 79, 34, 60, 92, 11, 41, 114}
Head position at 50
Output: Total number of seek operations = 510
Seek Sequence is
176
79
34
60
92
11
41
114
Therefore, the total seek count is calculated as:
= (176-50)+(176-79)+(79-34)+(60-34)+(92-60)+
(92-11)+(41-11)+(114-41) = 510