博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
操作系统磁盘调度_磁盘调度| 操作系统
阅读量:2528 次
发布时间:2019-05-11

本文共 4538 字,大约阅读时间需要 15 分钟。

操作系统磁盘调度

磁盘调度 (Disk Scheduling)

One of the major duties of the operating is that, to use the hardware orderly and accurately. For disk drives, it has a duty of having a fast access time and disk bandwidth. Generally, bandwidth is the total number of bytes, which need to be transferred, and then divided by the total time between the first service and the last transfer. In the case of disk structure, we have to improve both access time and the bandwidth with the help of scheduling the service of disk I/O requests in good order. By this there are many techniques comes for disk scheduling which is prescribed below.

操作的主要职责之一是有序,准确地使用硬件。 对于磁盘驱动器,它具有快速访问时间和磁盘带宽的职责。 通常,带宽是需要传输的总字节数,然后除以第一次服务和最后一次传输之间的总时间。 在磁盘结构的情况下,我们必须通过合理安排磁盘I / O请求的服务来改善访问时间和带宽。 通过这种方式,有许多用于磁盘调度的技术,如下所述。

1. FCFS调度 (1. FCFS Scheduling)

This is a simple scheduling algorithm which means first come first serve form of an algorithm. This kind of algorithm generally not provides the fastest service.

这是一种简单的调度算法,这意味着算法的先到先得形式。 这种算法通常不会提供最快的服务。

Consider the example: a disk queue with a request for I/O to blocks on cylinder 97, 182, 37, 128, and 15 in that order. If the disk head is initially at cylinder 52, so it will first move from 52 to 97, then 182, 37, 128, 15. There is a drastic change in the moment like 37 to 128 and then back to 15, it can generate the problem with this schedule.

请考虑以下示例:一个磁盘队列,该请求按顺序依次请求柱面97、182、37、128和15上的块的I / O。 如果磁盘头最初位于圆柱体52上,那么它将首先从52移至97,然后从182、37、128、15移动。此刻会发生剧烈变化,例如从37变为128,然后又回到15,则可以生成这个时间表的问题。

2. SSTF调度 (2. SSTF scheduling)

This is an algorithm which is termed as shortest seek time first algorithm. This type of algorithm selects the request with the minimum seek time from the current head position, as seek time is a time in which the arm has to move the head to the cylinder containing the desired sector. Seek time will be increased if the number of the head will be traversed by the head, as SSTF choose the request closest to the head position.

这是被称为最短寻道时间优先算法的算法。 这种类型的算法从当前磁头位置中选择具有最小寻道时间的请求,因为寻道时间是手臂必须将磁头移动到包含所需扇区的圆柱的时间。 如果SSTF选择最接近磁头位置的请求,那么如果磁头遍历磁头的数量,则搜索时间将会增加。

3.扫描计划 (3. SCAN Scheduling)

SCAN scheduling algorithm is also called the elevator algorithm because in such kind of algorithm arm behaves just like an elevator for building the way. In the SCAN algorithm, the arm will start at the one end of the disk and then move towards another end of the disk. At the last end, the head of the arm will be reversed and then this process continues.

SCAN调度算法也称为电梯算法,因为在这种算法中,手臂的行为就像电梯一样。 在SCAN算法中,机械臂将从磁盘的一端开始,然后朝磁盘的另一端移动。 最后,手臂的头部将反转,然后继续此过程。

4. C-SCAN调度 (4. C-SCAN Scheduling)

This kind of algorithm is termed as circular scan scheduling algorithm. This is designed to provide a uniform wait time. The C-SCAN algorithm treats the cylinder as the circular lists which will wrap the final cylinder to the first one. Although it is same as SCAN, in this also the head will move from one end to the another, when the head reaches the end it immediately return at a position of the beginning of the disk, without any request.

这种算法称为循环扫描调度算法。 这旨在提供统一的等待时间。 C-SCAN算法将圆柱体视为循环列表,它将最终圆柱体包装到第一个圆柱体中。 尽管与SCAN相同,但磁头也将从一端移动到另一端,当磁头到达一端时,它会立即返回磁盘起始位置,而无需任何请求。

5.查找计划 (5. LOOK scheduling)

This is the same as a SCAN algorithm, this algorithm kindly check the LOOKS to see whether there is any request which is pending in the direction of a head moment. Generally, according to the LOOK algorithm, the arm goes only as far as possible in each direction and then reverse direction without going to the end. The variant like scan is called LOOK scheduling because at last, they will look for a request before to move in a given direction.

这与SCAN算法相同,该算法请检查LOOKS,以查看是否有任何在头部力矩方向上待处理的请求。 通常,根据LOOK算法,机械臂只会在各个方向上尽可能远地移动,然后在不移动的情况下反向移动。 像scan这样的变量称为LOOK调度,因为最后,它们将在向给定方向移动之前先查找请求。

Selection of a Disk-Scheduling Algorithms

磁盘调度算法的选择

SSTF is a common algorithm which will increase the performance over the FCFS. SCAN and C-SCAN perform better for the system which places a heavy load on the disk because there is no such kind of a starvation problem. For any kind of the algorithm, the performance is basically dependent upon the number and the type of the requests. Disk scheduling algorithm should be written separately so that it can be replaced by a different algorithm if necessary. In this case, SSTF or LOOK is the best choice for the shortcoming algorithm.

SSTF是一种通用算法,它将提高FCFS的性能。 SCAN和C-SCAN在磁盘上负载较重的系统上表现更好,因为不存在此类饥饿问题。 对于任何一种算法,性能基本上都取决于请求的数量和类型。 磁盘调度算法应单独编写,以便在必要时可以用其他算法替换。 在这种情况下,SSTF或LOOK是该缺点算法的最佳选择。

翻译自:

操作系统磁盘调度

转载地址:http://vmxzd.baihongyu.com/

你可能感兴趣的文章
接口测试用例
查看>>
面试:用 Java 实现一个 Singleton 模式
查看>>
Sybase IQ导出文件的几种方式
查看>>
案例:手动输入一个字符串,打散放进一个列表,小写字母反序 大写字母保持不变...
查看>>
点语法
查看>>
IO之Socket网络编程
查看>>
PCRE demo【转】
查看>>
矩阵的SVD分解
查看>>
gitlab的配置
查看>>
linux访问ftp服务器命令
查看>>
ActiveMQ学习笔记之异常
查看>>
LuoguP4012 深海机器人问题(费用流)
查看>>
自动机
查看>>
java知识点
查看>>
WPF设计の画刷(Brush)
查看>>
HTML学习笔记
查看>>
selinux详解及配置文件
查看>>
性能优化之数据库优化
查看>>
Swift - 继承UIView实现自定义可视化组件(附记分牌样例)
查看>>
android自定义viewgroup实现等分格子布局
查看>>