Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(Fall 2009)
(7)
Disk Scheduling
Hani Salah
Copyright © BU / CAIS, 2009
1
Outline
Disk structure
Disk scheduling
Disk management
2
Disk structure
Disk drives are addressed as large 1-dimensional arrays of logical
blocks, where the logical block is the smallest unit of transfer.
Mapping proceeds in order through that track, then the rest of the
tracks in that cylinder, and then through the rest of the cylinders
from outermost to innermost.
3
Disk Structure
4
The focus here is on
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.
5
Disk scheduling … (cont.)
Several algorithms exist to schedule the servicing of disk
I/O requests.
In the examples:
Head starts at cylinder ( 53 )
In total, having 200 cylinders: ( 0-199 ).
6
(1) First-Come First-Served (FCFS)
Illustration shows total head movement of 640 cylinders.
7
(2) Shortest-Seek-Time-First (SSTF)
Selects the request with the minimum seek time from the current
head position.
It seems reasonable !
8
SSTF
9
(3) SCAN (Elevator)
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.
10
SCAN
11
(4) Circular SCAN (C-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.
12
C-SCAN
13
(5) LOOK and C-LOOK
14
C-LOOK
15
Example
Starting from the current head position, what is the total distance (in
cylinders) that the disk arm moves to satisfy all the pending requests,
for each of the following disk scheduling algorithms?
FCFS
SSTF
SCAN
LOOK
C-SCAN
C-look
16
Answers
The FCFS schedule is 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.
The total seek distance is 7081.
The SSTF schedule is 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774.
The total seek distance is 1745.
The SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999,
130, 86. The total seek distance is 9769.
The LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86.
The total seek distance is 3319.
The C-SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999,
0, 86, 130. The total seek distance is 9813.
The C-LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 86,
130. The total seek distance is 3363.
17
Source
Operating System Concepts 6th Edition, Silberschatz,
Galvin, and Gagne, John Wiley and Sons, Inc. 2002. (Slides of
Chapter 14)
18