Unit IV Disk Scheduling Algorithms: Disk Access Time Seek Time + Rotational Latency + Transfer Time
Unit IV Disk Scheduling Algorithms: Disk Access Time Seek Time + Rotational Latency + Transfer Time
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.
Example:
Suppose the order of request is- (82,51, 170,
49,43,140,24,16,190)And current position of
Read/Write head is : 50
51 49 43 24 16 82 140 170 190
Example:
Suppose the requests to be addressed are-82,170,43,140,24,16,190.
And the Read/Write arm is at 50, and it is also given that the disk arm
should move “towards the larger value”.
CSCAN: In SCAN algorithm, the disk arm again scans the path that has
been scanned, after reversing its direction. So, it may be possible that
too many requests are waiting at the other end or there may be zero or
few requests pending at the scanned area.
These situations are avoided in CSCAN algorithm in which the disk arm
instead of reversing its direction goes to the other end of the disk and
starts servicing the requests from there. So, the disk arm moves in a
circular fashion and this algorithm is also similar to SCAN algorithm and
hence it is known as C-SCAN (Circular SCAN).
Example:
Suppose the requests to be addressed are-82,170,43,140,24,16,190.
And the Read/Write arm is at 50, and it is also given that the disk arm
should move “towards the larger value”.
Example:
Suppose the requests to be addressed are-82,170,43,140,24,16,190.
And the Read/Write arm is at 50, and it is also given that the disk arm
should move “towards the larger value”.
So, the seek time is calculated as:=(190-50)+(190-
16)=314
Advantages
FSCAN along with N-Step-SCAN prevents “arm stickiness”
(phenomena in I/O scheduling where the scheduling algorithm
continues to service requests at or near the current sector and
thus prevents any seeking)
Each algorithm is unique in its own way. Overall Performance depends
on the number and type of requests.
Note:Average Rotational latency is generally taken as 1/2(Rotational
latency).
Exercise
1) Suppose a disk has 201 cylinders, numbered from 0 to 200. At some
time the disk arm is at cylinder 100, and there is a queue of disk access
requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If
Shortest-Seek Time First (SSTF) is being used for scheduling the disk
access, the request for cylinder 90 is serviced after servicing
____________ number of requests. (GATE CS 2014
(A) 1
(B) 2
(C) 3
(D) 4
Answer: (C)
(A) 6.1
Answer: (A)
Explanation:
Disk latency = Seek Time + Rotation Time + Transfer Time +
Controller Overhead Seek Time? Depends no. tracks the arm moves and
seek speed of disk Rotation Time? depends on rotational speed and
how far the sector is from the head Transfer Time? depends on data
rate (bandwidth) of disk (bit density) and the size of request Disk