Difference between Rotational Latency and Disk Access Time in Disk Scheduling
Operating systems do disk scheduling to schedule I/O requests arriving for the disk. Disk scheduling is important because multiple I/O requests may arrive by different processes, and only one I/O request can be served at a time by the disk controller. Thus other I/O requests need to wait in the waiting queue and need to be scheduled. There are some important terms: seek time, Rotational Latency, Transfer time, and Disk Access Time.
Seek time is measured defines the amount of time it takes a hard drive's read/write head to find the physical location of a piece of data on the disk. Latency is the average time for the sector being accessed to rotate into position under ahead, after a completed seeks.
What is Rotational Latency?
The disk is divided into many circular tracks, and these tracks are further divided into blocks known as sectors. To access data, the actuator arm moves the read-write head over the platter to a particular track while the platter spins to position the requested sector under the read-write head. The time taken by the platter to rotate and position the data under the read-write head is called rotational latency.
This latency depends on the rotation speed of the spindle and is measured in milliseconds. The average rotational latency for a disk is half the amount of time it takes for the disk to make one revolution.
Rotational Latency time depends on the rotational speed of a disk or spindle motor, measured in revolutions per minute (RPM). For most magnetic media-based drives, the average rotational latency is typically based on the empirical relation that the average latency in milliseconds for such a drive is one-half the rotational period. Here are the two types of disk rotation methods:
For example, we have divided each track into 4 sectors. The systems get a request to read a sector from track 1. Thus the read/write head will move to track 1, which will be seek time. The read/write head is currently in sector 3 in the following diagram shown below.
But the data may not be in sector 3, and the data block may be present in sector 1. The time required by the read/write head to move from sector 3 to sector 1 is the rotational latency shown in the next diagram below.
The following formula is used to calculate rotational latency in disk scheduling.
All platters have their own read-write head. The head can only be moved forward and backward. If the header is moving forward, it means that the header is moving towards the innermost track. If the header is moved backward, it means that the header is moving towards the outermost track.
In the below example, we used the formula to calculate the rotational latency,
What is Disk Access Time?
Disk Access Time is defined as the total time required by the computer to process a read/write request and then retrieve the required data from the disk storage.
There are two components in disk access time. The first component is seek time which occurs when the read and write arm seeks the desired track. The second component is latency or wait time which occurs when the head write arm waits for the desired sector on the track to spin around.
Access to the data on disks is measured in terms of milliseconds. However, this is much slower than the processing speeds of CPUs. Although I/O is still slow, it cannot match the speed improvements of modern processors. Disk Access Time is divided into two parts:
You can calculate the disk access time by using the following formula.
1. Access Time
Access Time is defined as the setup time before the actual data transfer takes place. For example, the read/write head is on track 1, but we need to read data from another track or segment. Thus, the read/write head will move to the data block location before the actual transfer occurs. This delay is called Access Time. Access Time is calculated by summation of the following:
NOTE: Command Processing Time and Settle Time are not normally mentioned in the numerical question, and we take them as zero.
2. Data Transfer Time
Data Transfer Time is defined as the time required to transfer data between the system and the disk. Data Transfer Time is two types:
Difference between Rotational Latency and Disk Access Time
Below are some differences between rotational latency and disk access time in disk scheduling, such as: