Hard Drive Seek Time using FIFO, SSF, SCAN

A hard disk spins at 6000 rpm (revolutions per minute), and it takes 100 μs (on average) for the head to traverse one track. Consider the following sequence of disk track requests: 27, 129, 110, 186, 147, 41, 10, 64, 120. Assume that initially the head is at track 30 and is moving in the direction of decreasing track numbers. Compute the time it takes to serve the requests using (1) FIFO, (2) SSF (Shortest-Seek First), (3) SCAN.

I understand the difference between the different algorithms and I generally get how to calculate it.

My questions is, when I calculate the Average rotational time, i.e. (60/6000) / 2 = 5ms, do I need to multiply this by the number of tracks moved?

My FIFO calculation as an example:

(3+102+19+76+39+106+31+54+56) * (5ms + 0.1ms) = 2478.6ms

I add up the number of tracks moved and multiply this by the average rotational time + the time it takes to traverse each track.

Is this approach correct?

Thank you

• Well, what does the rotational delay (why do you divide rotation time by 2?) mean? To how many tracks/cylinders does this apply? – greybeard May 21 '20 at 5:17

1 Answer

@greybeard why he divided by 2 on average we will need to wait for half a rotation of the disk for the correct sector to come under the head. Thus, on average, the rotational latency is half the time it takes the disk to make a complete revolution.

do I need to multiply this by the number of tracks moved? No. Because average rotational time is the time to move head from one sector to any other sector in same track. This movement is done by disk rotation.

In your question we will consider any sector in given track. So when track changes from 30 to 27, it takes 3 track movement and 1 average rotation so time 3*0.1+5

In general, total time = seek time + rotating latency

Seek time : time to change track

Edited

(3+102+19+76+39+106+31+54+56)*0.1 + number_of_time_movement_occured * rotational_latency
= 486 * 0.1 + 9 * 5
= 48.6 + 45
= 93.6

• initially you say when the track changes from 30 to 27 it takes 3*0.1+5 but then below you add up all the track movements and multiply by 5, which was my question exactly (you negated that in your answer previously though). Also, in that initial movement you multiply 0.1 by 3 (i.e. number of tracks moved), whereas in your answer below you only multiply 0.1 by 9 (i.e. the number of track request). So either it should be 2 instead of 3 or 486 instead of 9, but that doesn't look coherent to me. – SanMu May 21 '20 at 9:18
• When track changed, we are considering disk rotated also. so average rotational latency added but it takes 100 μs (on average) for the head to traverse one track. Means ans will be (3*0.1+5) + (102*0.1 + 5) + (19 *0.1+5) + .... + (56*0.1+5). I just took number_of_time_movement_occured * rotational_latency out. – PSKP May 21 '20 at 9:32
• ok but then it should be (3*5 + 0.1) + (102*5 + 0.1) + ... + (56*5 + 0.1) which simplifies to 486 * 5 + 9 * 0.1, no? – SanMu May 21 '20 at 9:43
• Oh sorry I just swapped two values mistakenly. – PSKP May 21 '20 at 9:48
• If you satisfied with this answer. Please accept it. – PSKP May 21 '20 at 10:07