13.
Mass Storage Structure
Disk Scheduling:
1) The operating system is responsible for using hardware efficiently — for the disk
drives, this means having a fast access time and disk bandwidth.
2) Access time has two major components
a) Seek time is the time for the disk are to move the heads to the cylinder
containing the desired sector.
b) Rotational latency is the additional time waiting for the disk to rotate the
desired sector to the disk head.
3) Minimize seek time
4) Seek time » seek distance
5) Disk bandwidth is the total number of bytes transferred, divided by the total time
between the first request for service and the completion of the last transfer.
6) Several algorithms exist to schedule the servicing of disk I/O requests.
7) We illustrate them with a request queue (0-199).
98, 183, 37, 122, 14, 124, 65, 67
Head pointer 53
1. FCFS Scheduling:
The simplest form of disk scheduling is First-come, First-served (FCFS). This
algorithm is basically fair, but it generally does not provide the fastest service.
Page 1
Ex:
To the above example, total head movement of 640 cylinders.
2. SSTF (Shortest Seek Time First) Scheduling:
a) SSTF selects the request with the minimum seek time from the current head position.
b) SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.
Ex: This shows total head movement of 236 cylinders.
Page 2
3) SCAN Scheduling:
a) In the SCAN algorithm, 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.
b) Sometimes this algorithm is also called the elevator algorithm because the disk arm
behaves just like elevator in a building, first servicing all the requests going up and
then reversing to service requests the other way.
Ex: This algorithm shows total head movement of 208 cylinders.
4) C-SCAN Scheduling:
a) This scheduling algorithm provides a more uniform wait time than SCAN.
b) The head moves from one end of the disk to the other, servicing requests along the
way. When it reaches the other end, however, it immediately returns to the beginning
of the disk, without servicing any requests on the return trip.
c) The C-SCAN scheduling algorithm treats the cylinders as a circular list that wraps
around from the last cylinder to the first one.
Page 3
Ex:
5) C-LOOK Scheduling:
a) This C-LOOK is the version of C-SCAN
b) More commonly, the 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.
Ex:
Page 4
Selecting a Disk-Scheduling Algorithm:
a) SSTF is common and has a natural appeal
b) SCAN and C-SCAN perform better for systems that place a heavy load on the disk.
c) Performance depends on the number and types of requests.
d) Requests for disk service can be influenced by the file-allocation method.
e) 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.
f) Either SSTF or LOOK is a reasonable choice for the default algorithm.
************** End of Chapter : 13 **************
Page 5