Module13: Secondary- Storage二级存储 ● Disk Structure 磁盘结构 ° Disk Scheduling 磁盘调度 ° Disk Management 磁盘管理 Swap-Space Management交换空间管理 · Disk Reliability 磁盘可靠性 ° Stable-Storage Implementation稳定存储实现 Tertiary Storage Devices 三级存储设备 Operating System Issues 有关操作系统的问题 ● Performance ssues 有关性能的问题 Applied Operating System Concepts 13.1 Silberschatz, Galvin, and Gagne @1999
13.1 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Module 13: Secondary-Storage 二级存储 • Disk Structure 磁盘结构 • Disk Scheduling 磁盘调度 • Disk Management 磁盘管理 • Swap-Space Management 交换空间管理 • Disk Reliability 磁盘可靠性 • Stable-Storage Implementation 稳定存储实现 • Tertiary Storage Devices 三级存储设备 • Operating System Issues 有关操作系统的问题 • Performance Issues 有关性能的问题
Disk Structure磁盘结构 Disk drives are addressed as large 1-dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.磁盘设备是以一种逻辑块的一维大数组的形式编址 的,这里的逻辑块是传输的最小单位。 The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially.逻辑块的一维数组映射到磁 盘上一些相连的扇区 Sector 0 is the first sector of the first track on the outermost cylinder.0扇区是最外边柱面的第一个磁道的 第一个扇区。 Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost. 3ta 首先都映射到一个磁道,其余的数据映射到同一柱面的其 他磁道,然后按照从外向里的顺序映射到其余的柱面。 Applied Operating System Concepts 13.2 Silberschatz, Galvin, and Gagne @1999
13.2 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Disk Structure 磁盘结构 • Disk drives are addressed as large 1-dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer. 磁盘设备是以一种逻辑块的一维大数组的形式编址 的,这里的逻辑块是传输的最小单位。 • The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially. 逻辑块的一维数组映射到磁 盘上一些相连的扇区。 – Sector 0 is the first sector of the first track on the outermost cylinder. 0扇区是最外边柱面的第一个磁道的 第一个扇区。 – Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost. 数据 首先都映射到一个磁道,其余的数据映射到同一柱面的其 他磁道,然后按照从外向里的顺序映射到其余的柱面
Disk Scheduling磁盘调度 The operating system is responsible for using hardware efficiently for the disk drives, this means hav ing a fast access time and disk bandwidth.操作系统有责任高效地使用硬件——对 于磁盘设备,这意味着很短的访问时间和磁盘带宽。 Access time has two major components访问时间包括两个主要 部分 Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector..寻道时间是指把 磁头移到所需柱面的时间 Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head.旋转延迟是指 等待磁盘上所需要的扇区旋转到磁头下面的时间。 Minimize seek time最小寻道时间 Seek time≈ seek distance寻道时间≈寻道距离 Disk bandwidth is the total number of bytes transferred, div ided by the total time between the first request for serv ice and the completion of the last transfer.磁盘带宽,是用传输的总位数,除 以第一个服务请求与最后传输完成之间的总时间。 Applied Operating System Concepts 13.3 Silberschatz, Galvin, and Gagne @1999
13.3 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Disk Scheduling 磁盘调度 • The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk bandwidth. 操作系统有责任高效地使用硬件——对 于磁盘设备,这意味着很短的访问时间和磁盘带宽。 • Access time has two major components 访问时间包括两个主要 部分 – Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector. 寻道时间是指把 磁头移到所需柱面的时间。 – Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. 旋转延迟是指 等待磁盘上所需要的扇区旋转到磁头下面的时间。 • Minimize seek time 最小寻道时间 • Seek time seek distance 寻道时间 寻道距离 • Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer. 磁盘带宽,是用传输的总位数,除 以第一个服务请求与最后传输完成之间的总时间
Disk Scheduling(cont)磁盘调度(续 Several algorithms exist to schedule the servicing of disk I/O requests.有几种磁盘Wo请求的服务调度算法 We illustrate them with a request queue(0-199),.我们假设 个请求序列。 98,183,37,122,14,124,65,67 Head pointer53磁头当前的位置在53 Applied Operating System Concepts 13.4 Silberschatz, Galvin, and Gagne @1999
13.4 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Disk Scheduling (Cont.) 磁盘调度(续 ) • Several algorithms exist to schedule the servicing of disk I/O requests. 有几种磁盘I/O请求的服务调度算法 • We illustrate them with a request queue (0-199). 我们假设一 个请求序列。 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53 磁头当前的位置在53
FcFS先来先服务 llustration shows total head movement of640 cylinders.如下图所示,磁头总 共移动了640个柱面的距离。 queue=98,183,37,122,14,124,65,67 head starts at 53 014 37536567 98122124 183199 Applied Operating System Concepts 13.5 Silberschatz, Galvin, and Gagne @1999
13.5 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts FCFS 先来先服务 Illustration shows total head movement of 640 cylinders. 如下图所示,磁头总 共移动了640个柱面的距离