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:

1. Constant linear velocity (CLV), used mainly in optical storage, varies the rotational speed of the optical disc depending upon the position of the head, and
2. Constant angular velocity (CAV) used in HDDs, standard FDDs, a few optical disc systems, and vinyl audio records spins the media at one constant speed regardless of where the head is positioned.

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.

Formula

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.

• Best Case = When the header is already in the desired sector.
• Worst Case = When the header is at the sector far away from the desired sector, you have to wait for one complete rotation.
• Average Case = Half of the rotation time.

Example

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:

1. Access Time
2. Data Transfer Time

Formula

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:

• Seek Time: The time taken by the read/write head to reach the desired output. It is known to be the most important time because it cannot create a gap. Seek time is inversely proportional to the performance. The lesser seek time, the better will be the performance.
• Rotational Latency: The time required by the read/write head to move from the current sector to the requested sector.
• Command Processing Time: It is the time required by the disk device to process the command and establish a connection between the various components of the disk device to read/write data. It is due to the internal circuitry.
• Settle Time: Settle time is the time required by the read/write head to stop vibrating.

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:

• Internal Transfer Rate: It is defined as the time required to move data between the disk surface and the hard disk cache.
• External Transfer Rate: It is defined as the time required to move data between the hard disk cache and the system.

Difference between Rotational Latency and Disk Access Time

Below are some differences between rotational latency and disk access time in disk scheduling, such as:

Rotational Latency Disk Access Time
It is the time required by the read/write head to move from one sector to another. It is the time required by the computer to process a read/write request and retrieve the required data.
Most disk scheduling does not consider rotational frequency because, in a most modern system, the actual physical location of blocks is not available. It is very large compared to Seek time.
Rotational latency depends on the rotational speed of the spindle. Disk Access Time depends on two parts, i.e., access time and data transfer time.
Rotational latency can be reduced if a subsequent request belongs to an adjacent sector. We can reduce Disk Access Time if we can reduce access time and data transfer time.
Rotational latency,
= (Angle between the current sector and the required sector) / (Rotational frequency).
Disk Access Time,
= Seek time + Rotational Latency + Data Transfer Time