📜  磁盘调度中旋转延迟和磁盘访问时间的区别

📅  最后修改于: 2021-09-11 04:05:18             🧑  作者: Mango

1. 旋转延迟:
旋转延迟也称为旋转时间。当读/写磁头到达确切扇区时磁盘旋转磁道所花费的时间,或者我们也可以说所需扇区进入读/写磁头所花费的时间称为旋转延迟。旋转延迟取决于主轴的旋转速度。

Rotational Latency, 
= (Angle between current sector and required sector) / (Rotational frequency) 

和,
平均旋转延迟,
= (1/2) * 一圈时间

所有的盘片都有自己的读/写头。头部只能前后移动。如果标题向前移动,则意味着标题正在向最里面的轨道移动。如果标题向后移动,则意味着标题正在向最外层轨道移动。

  • 最佳情况,= 当标头已在所需扇区中时。
  • 最坏情况 = 当标头位于远离所需扇区的扇区时。你必须等待一个完整的轮换。
  • 平均情况 = 轮换时间的一半。

例子 –

Let Speed = 2400 RPM (Rotation Per Minute)
Then, 2400 Rotation = 1 min 
1 Rotation = 60 sec / 2400     // 1 min = 60 sec
1 Rotation = 1/40 sec

One Rotation Time, 
= 1/40 sec

Average Rotational Latency, 
= (1/2) * (1/40)
= 1/80 sec 

磁盘存取时间:
磁盘访问时间是计算机处理来自处理器的数据请求然后传输数据所花费的总时间。当程序必须从磁盘读取信息时,系统应该旋转数据所在的圆、磁道和扇区。

Disk Access Time, 
= Seek time + Rotation time + Rotational Latency + Transfer time 

磁盘访问时间包括 –

  1. 寻找时间——
    它是读/写头达到所需输出所花费的时间。众所周知,这是最重要的时间,因为它不会造成间隙。寻道时间与性能成反比。寻道时间越短,性能越好。
    Average seek time, 
    = (1/3) * time taken for one full stroke 
  2. 旋转时间 –
    它是完整旋转一圈(360 度)所需的总时间。为了到达所需的扇区,磁盘将以顺时针方向或逆时针方向由主轴旋转,但一次只能在一个方向上移动。
  3. 旋转延迟 –
    当读/写磁头到达精确扇区时磁盘旋转磁道所花费的时间。
    Average rotational latency, 
    = (1/2) * one rotation time  
  4. 数据传输时间 –
    这是传输数据所花费的时间。
    Data transfer time, 
    = (Data to be transfer) / (Transfer rate) 

磁盘调度中的旋转延迟和磁盘访问时间之间的区别:

ROTATIONAL LATENCY DISK ACCESS TIME
The time taken by the desired sector in disk to come under read/write head is known as Rotational Latency. Disk Access Time is basically the time required by computer to process a read/write request and also to retrieve required data.
Rotational Latency depends on rotational speed of the spindle. Disk Access Time depends on two parts i.e. access time and data transfer time.
Average rotational latency can be written as :
Avg Rotational Latency = (1/2) * One rotation time.
Disk Access Time can be written as :
Access time + Data Transfer Time.
Rotational Latency Time can be reduced if subsequent request belongs to adjacent sector. We can reduce Disk Access Time if we are able to reduce access time and data transfer time.
Rotational Latency,
= (Angle between current sector and the required sector) / (Rotational frequency).
Disk Access Time,
= Seek time + Rotational Latency + Data Transfer Time