目标
n Describe the physical structure of secondary and
描述第二层和第三层的物理结构
tertiary storage devices and the resulting effects on the uses of the devices
三级存储设备及其对设备使用的影响
n Explain the performance characteristics of mass-storage devices
解释大容量存储设备的性能特征
n Discuss operatingsystem services provided for
讨论提供的操作系统服务
mass storage, including RAID and HSM
海量存储,包括磁盘阵列和HSM
(Hierarchical Storage Management )
(分层存储管理)
12.1 Overview of Mass Storage Structure
海量存储结构概述
n Magnetic disks provide bulk of secondary storage
磁盘提供大量二级存储
of modern computers
现代计算机
l Drives rotate at 60 to 200 times per second
驱动器每秒钟旋转60至200次
l Transfer rate is rate at which data flow between
传输速率是数据在
drive and computer
驱动器和计算机
l Positioning time (randomaccess time) is time to
定位时间(随机访问时间)是指
move disk arm to desired cylinder (seek time)
将磁盘臂移动到所需的柱面(寻道时间)
and time for desired sector to rotate under the
和所需扇区旋转的时间
disk head (rotational latency)
磁盘磁头(旋转延迟)
l Head crash results from disk head making
磁头碰撞是磁盘磁头制造的结果
contact with the disk surface à That’s bad
与磁盘表面接触这很糟糕
Movinghead Disk Mechanism
移动磁头磁盘机构
Overview of Mass Storage Structure
海量存储结构概述
n Disks can be removable
磁盘可以移动
n Drive attached to computer via I/O bus
通过输入/输出总线连接到计算机的驱动器
l Busses vary, including EIDE, ATA, SATA, USB,
总线各不相同,包括EIDE、ATA、SATA、USB,
Fibre Channel (FC), SCSI
光纤通道、SCSI
l Host controller in computer uses bus to talk to
电脑中的主机控制器使用总线进行通信
disk controller built into drive or storage array
内置于驱动器或存储阵列中的磁盘控制器
Overview of Mass Storage Structure (Cont.)
海量存储结构概述(续)。)
n Magnetic tape
磁带
l Was early secondarystorage medium
早期二级存储介质
l Relatively permanent and holds large quantities of data
相对持久,保存大量数据
l Access time slow
访问时间缓慢
l Random access ~1000 times slower than disk
随机存取——比磁盘慢1000倍
l Mainly used for backup, storage of infrequentlyused
主要用于备份、存储不常使用的
data, transfer medium between systems
数据,系统间的传输媒介
l Kept in spool and wound or rewound past readwrite
保持在线轴上,并在读写后缠绕或重新缠绕
head
头
l Once data under head, transfer rates comparable to
一旦数据在标题下,传输速率相当于
disk
圆盘
l 20200GB typical storage
20200GB典型存储空间
12.2 Disk Structure
磁盘结构
n Disk drives are addressed as large 1dimensional arrays
磁盘驱动器被视为大型一维阵列
of logical blocks, where the logical block is the smallest
逻辑块,其中逻辑块最小
unit of transfer.
转移单位。
n The 1dimensional array of logical blocks is mapped into
逻辑块的一维数组映射到
the sectors of the disk sequentially.
磁盘的扇区按顺序排列。
l Sector 0 is the first sector of the first track on the
扇区0是第一条轨道的第一个扇区
outermost cylinder.
最外面的圆柱体。
l 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.
最里面。
12.3 Disk Attachment
12.3磁盘附件
n Hostattached storage accessed through I/O ports
通过输入/输出端口访问的主机连接存储
talking to I/O busses
与输入输出总线对话
n SCSI itself is a bus, up to 16 devices on one cable, SCSI
SCSI本身就是一条总线,一条电缆上最多有16个设备,SCSI
initiator requests operation and SCSI targets perform
启动器请求操作,SCSI目标执行
tasks
任务
l Each target can have up to 8 logical units (disks attached to device controller)
每个目标最多可以有8个逻辑单元(磁盘连接到设备控制器)
n FC (Fiber Channel) is highspeed serial architecture
光纤通道是高速串行架构
l Can be switched fabric with 24bit address space the basis of storage area networks (SANs) in which many
可以是24位地址空间的交换结构,这是存储区域网络的基础
hosts attach to many storage units
主机连接到许多存储单元
l Can be arbitrated loop (FCAL) of 126 devices
可仲裁126台设备的环路(FCAL)
NetworkAttached Storage (NAS)
网络连接存储
n Networkattached storage (NAS) is storage made available
网络连接存储是否可用
over a network rather than over a local connection (such as
通过网络而不是本地连接(例如
a bus)
公共汽车)
n NFS and CIFS are common protocols
NFS和CIFS是共同的协议
n Implemented via remote procedure calls (RPCs) between
通过远程过程调用(远程过程调用)实现
host and storage
主机和存储
n New iSCSI protocol uses IP network to carry the SCSI
新iSCSI协议使用知识产权网络来承载SCSI
protocol
协议
Storage Area Network (SAN)
存储区域网络
n Common in large storage environments (and becoming more common)
在大型存储环境中很常见(并且越来越常见)
n Multiple hosts attached to multiple storage arrays flexible
多个主机灵活连接到多个存储阵列
12.4 Disk Scheduling
磁盘调度
n The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast
操作系统负责高效使用硬件——对于磁盘驱动器,这意味着要有一个快速的
access time and disk bandwidth.
访问时间和磁盘带宽。
n Access time has two major components
访问时间有两个主要组成部分
l Seek time is the time for the disk arm to move the
寻道时间是指磁盘臂移动的时间
heads to the cylinder containing the desired sector.
指向包含所需扇区的柱面。
l Rotational latency is the additional time waiting for the
旋转延迟是等待的额外时间
disk to rotate the desired sector to the disk head.
磁盘将所需扇区旋转到磁盘头。
n Minimize seek time
最小化寻道时间
n Seek time » seek distance
寻找时间»寻找距离
n 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.)
磁盘调度(续。)
n Several algorithms exist to schedule the servicing of disk
存在多种算法来安排磁盘服务
I/O requests.
输入输出请求。
n We illustrate them with a request queue (0199 cylinders).
我们用一个请求队列(0199个气缸)来说明它们。
98, 183, 37, 122, 14, 124, 65, 67
98, 183, 37, 122, 14, 124, 65, 67
Head pointer 53
磁头指针53
FCFS (First Come First Service)
先到先得服务
Illustration shows total head movement of 640 cylinders.
图显示了640个气缸的总气缸盖移动量。
SSTF (Shortest Seek Time First)
SSTF(最短寻道时间优先)
n Selects the request with the minimum seek time from the
从列表中选择寻道时间最短的请求
current head position.
当前磁头位置。
n SSTF scheduling is a form of SJF scheduling;may cause
SSTF调度是SJF调度的一种形式;可能导致
starvation of some requests.
一些请求的饥饿。
n Illustration shows total head movement of 236 cylinders.
图示显示了236个气缸的总气缸盖运动。
SSTF (Cont.)
SSTF(续)。)
SCAN
扫描
n 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.
反转,维修继续。
n Sometimes called the elevator algorithm.
有时被称为电梯算法。
n Illustration shows total head movement of 208 cylinders.
图示显示了208个气缸的总气缸盖运动。
SCAN (Cont.)
扫描(续。)
CSCAN
循环扫描
n Provides a more uniform wait time than SCAN.
提供比扫描更均匀的等待时间。
n The head moves from one end of the disk to the other.
磁头从磁盘的一端移动到另一端。
servicing requests as it goes.
服务请求。
n When it reaches the other end, however, it immediately
然而,当它到达另一端时,它会立即
returns to the beginning of the disk, without servicing any requests on the return trip.
返回到磁盘的开头,在返回过程中不处理任何请求。
n Treats the cylinders as a circular list that wraps around
将气缸视为一个环绕的圆形列表
from the last cylinder to the first one.
从最后一个圆柱体到第一个圆柱体。
CSCAN (Cont.)
CSCAN(续。)
CLOOK (or LOOK)
CLOOK(或LOOK)
n Versions of SACN and CSCAN
SACN和CSCAN的版本
n Arm only goes as far as the last request in each
Arm仅处理每个请求中的最后一个请求
direction, then reverses direction immediately,
方向,然后立即反转方向,
without first going all the way to the end of the
而不是一路走到最后
disk.
磁盘。
n They look for a request before continuing to
他们在继续下一步之前会寻找一个请求
move in a given direction.
向给定的方向移动。
CLOOK (Cont.)
CLOOK(续。)
Selecting a DiskScheduling Algorithm
选择磁盘调度算法
n SSTF is common and has a natural appeal
SSTF很普通,有着天然的吸引力
n SCAN and CSCAN perform better for systems that place a
扫描和计算机支持的网络对系统的性能更好
heavy load on the disk.
磁盘负载过重。
n Performance depends on the number and types of
性能取决于数量和类型
requests.
请求。
n Requests for disk service can be influenced by the file
文件可能会影响对磁盘服务的请求
allocation method.
分配方法。
n The diskscheduling algorithm should be written as a separate module of the operating system, allowing it to be
磁盘调度算法应该作为操作系统的一个独立模块来编写,允许它
replaced with a different algorithm if necessary.
如有必要,替换为不同的算法。
n Either SSTF or LOOK is a reasonable choice for the default
SSTF或LOOK是违约的合理选择
algorithm.
算法。
12.5 Disk Management