0
$\begingroup$

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

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

@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
$\endgroup$
9
  • $\begingroup$ 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. $\endgroup$ – SanMu May 21 '20 at 9:18
  • $\begingroup$ 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. $\endgroup$ – PSKP May 21 '20 at 9:32
  • $\begingroup$ 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? $\endgroup$ – SanMu May 21 '20 at 9:43
  • $\begingroup$ Oh sorry I just swapped two values mistakenly. $\endgroup$ – PSKP May 21 '20 at 9:48
  • $\begingroup$ If you satisfied with this answer. Please accept it. $\endgroup$ – PSKP May 21 '20 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.