当前位置:文档之家› 第7章设备管理磁盘

第7章设备管理磁盘

98, 183, 37, 122, 14, 124, 65, 67
Head pointer: 53
第7章设备管理磁盘
FCFS
Illustration shows total head movement of 640 cylinders.
第7章设备管理磁盘
SSTF(Shortest Seek Time First) 最短寻道时间优先
l 旋转延迟时间(rotation time)
– 当前位置旋转到所需物理块的时间
l 传输时间(transfer time)
– 实际磁盘访问操作所需时间
l 注:磁头移动约占总访问时间的70%
第7章设备管理磁盘
磁盘的驱动调度
l 先移臂调度 l 再旋转调度 l 目标:
– 移臂时间最短 – 旋转周数最少
第7章设备管理磁盘
l Selects the request with the minimum seek time from the current head position.
l SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.
第7章设备管理磁盘
N-Step-SCAN
FCFS
SCAN
第7章设备管理磁盘
FSCAN
l N-Step-SCAN算法的简化 l 两个子队列
– 当前所有请求磁盘I/O的进程形成的队列, 以SCAN算法处理
– 在扫描期间新出现的所有请求磁盘I/O的进 程形成的队列,作为等待处理的队列
第7章设备管理磁盘
l SFT-III
– 高级磁盘容错技术,SFT III allows two servers to mirror each other so that one server is always available in case the other one fails.
第7章设备管理磁盘
SFT-I
磁盘的驱动调度
l 驱动调度的目的
– 减少I/O请求服务所需的总时间,提高系统 效率
l 影响驱动调度的因素
– I/O请求优化排序 – 信息在辅存上的排列方式 – 文件在辅存上的分配方法
第7章设备管理磁盘
磁盘移臂调度算法
l 目标:
– 使磁盘的平均寻道时间最少
l Seek time seek distance
l 双份目录和双份FAT l 热修复重定向
– 将一定磁盘容量作为热修复重定向区,某磁 盘块有缺陷时从中选择一块
l 写后读检验
第7章设备管理磁盘
磁盘镜像
SFT-II
磁盘双工
第7章设备管理磁盘
RAID ( 廉价磁盘冗余阵列 )
l 并行交叉存取 l RAID分级
– RAID 0 – RAID 1 – RAID 2 – RAID 3 – RAID 4 – RAID 5 – RAID 6 – RAID 7
2、 磁盘容错技术
l 在系统中设置冗余部件提高系统可靠性 l 磁盘容错技术
– 磁盘驱动器冗余 – 磁盘控制器冗余
第7章设备管理磁盘
SFT( System Fault Tolerance )
l SFT-I
– 低级磁盘容错技术、防止磁盘表面发生缺陷导致数 据丢失
l SFT-II
– 中级磁盘容错技术、防止磁盘驱动器/控制器故障导 致系统不能正常工作
第7章设备管理磁盘
SCAN
l 在考虑欲访问磁道与当前磁盘距离时,优先考虑磁 盘的当前移动方向
l The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues.
第7章设备管理磁盘
SCAN算法存在问题
l 当磁头刚移过某一磁道时,恰有一进程 提出对此磁道的访问请求,此时,该进 程必须等待磁头按本方向扫描完所有要 访问的磁道后,并反方向扫描回来时才 处理该请求
l 进程请求被严重推迟
第7章设备管理磁盘
C-SCAN
l Provides a more uniform wait time than SCAN. l The head moves from one end of the disk to the
第7章设备管理磁盘
移臂调度算法
l 先来先服务算法(FCFS)
– 按I/O请求到达顺序处理
l 最短寻道时间优先法(SSTF)
– 先完成距当前存取臂距离最近的柱面上的I/O请求
l 扫描法(SCAN,电梯调度算法) l 循环扫描(Circular SCAN) l N-Step-SCAN算法 l FSCAN算法
other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. l Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.
第7章设备管理磁盘
2020/11/27
第7章设备管理磁盘
1、磁盘I/O
l 提高磁盘I/O速度的主要途径
– 选择性能好的磁盘 – 采用好的磁盘调度算法 – 设置磁盘Cache
第7章设备管理磁盘
磁盘的类型
l 硬盘——软盘 l 单片盘——多片盘 l 固定头磁盘——移动头磁盘
– 固定头磁盘(访问速度快,成本高) – 移动头磁盘(访问速度较慢,成本较低)
第7章设备管理磁盘
How to Seek??
第7章设备管理磁盘
Disk Scheduling
l Several algorithms exist to schedule the servicing of disk I/O requests.
l We illustrate them with a request queue (0-199):
第7章设备管理磁盘
硬盘(Hard Disk)
l 柱面 Cylinder l 磁道 Track l 扇区 Sector l 磁头 Head
第7章设备管理磁盘
磁盘结构
扇区 Sector
第7章设备管理磁盘
访问磁盘所需时间
l 寻道时间——磁头移动时间(seek time)
– 当前位置移到正确磁道的时间
第7章设备管理磁盘
C-SCAN
第7章设备管理磁盘
上述算法可能出现的问题
l 磁臂粘着(Armstickiness)
– 磁臂长期停留在某处不动的情况
第7章设备管理磁盘
N-Step-SCAN
l 将磁盘请求队列分成若干个长度为N的子 队列
l 磁盘调度按FCFS处理这些子队列 l 针对每个子队列采用SCAN算法
l Now the disk arm is moving toward 0 l Sometimes called the elevator algorithm. l Illustration shows total head movement of 208 cylinders.
第7章设备管理磁盘
Байду номын сангаас
SCAN
l Illustration shows total head movement of 236 cylinders.
第7章设备管理磁盘
SSTF (640236)
第7章设备管理磁盘
SSTF
l 饥饿现象(Starvation)
– 系统中不断有新进程到达,且新进程要访问 的磁道与磁头当前所在磁道的距离较近时, 新进程的I/O请求被优先满足,导致老进程 出现饥饿现象
第7章设备管理磁盘
后备系统
l 类型
– 磁带:容量大、价廉、速度慢、顺序存取 – 硬盘:容量大、速度快、价高 – 光盘:容量大、保存期长
第7章设备管理磁盘
3rew
演讲完毕,谢谢听讲!
再见,see you again
2020/11/27
第7章设备管理磁盘
相关主题