[精选]操作系统有责任高效地使用硬件对于磁盘设备5305.pptx
《[精选]操作系统有责任高效地使用硬件对于磁盘设备5305.pptx》由会员分享,可在线阅读,更多相关《[精选]操作系统有责任高效地使用硬件对于磁盘设备5305.pptx(45页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Chapter 14:Mass-Storage SystemslDisk StructurelDisk SchedulinglDisk ManagementlSwap-Space ManagementlRAID StructurelDisk AttachmentlStable-Storage ImplementationlTertiary Storage DeviceslOperating System IssueslPerformance Issues 1 3/17/2023Disk StructurelDisk drives are addressed as large 1-dimensi
2、onal arrays of logical blocks,where the logical block is the smallest unit of transfer.lThe 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially.nSector 0 is the first sector of the first track on the outermost cylinder.nMapping proceeds in order through that tra
3、ck,then the rest of the tracks in that cylinder,and then through the rest of the cylinders from outermost to innermost.2 3/17/2023Disk SchedulinglThe operating system is responsible for using hardware efficiently for the disk drives,this means having a fast access time and disk bandwidth.操作系统有责任高效地使
4、用硬件操作系统有责任高效地使用硬件对于磁盘设备,这意味对于磁盘设备,这意味着很短的访问时间和磁盘带宽。着很短的访问时间和磁盘带宽。lAccess time has two major components 访问时间包括两个主访问时间包括两个主要部分要部分nSeek time is the time for the disk are to move the heads to the cylinder containing the desired sector.寻道时间是指寻道时间是指把磁头移到所需柱面的时间。把磁头移到所需柱面的时间。nRotational latency is the addi
5、tional time waiting for the disk to rotate the desired sector to the disk head.旋转延迟是旋转延迟是指等待磁盘上所需要的扇区旋转到磁头下面的时间。指等待磁盘上所需要的扇区旋转到磁头下面的时间。3 3/17/2023Disk SchedulinglMinimize seek time 最小寻道时间最小寻道时间lSeek time seek distance 寻道时间寻道时间 寻道距离寻道距离lDisk bandwidth is the total number of bytes transferred,divided
6、by the total time between the first request for service and the completion of the last transfer.磁盘带宽,是用传输的总位数,除以第一个服务请求与最磁盘带宽,是用传输的总位数,除以第一个服务请求与最后传输完成之间的总时间。后传输完成之间的总时间。4 3/17/2023Disk Scheduling(Cont.)lSeveral algorithms exist to schedule the servicing of disk I/O requests.lWe illustrate them with
7、 a request queue(0-199).98,183,37,122,14,124,65,67Head pointer 53 5 3/17/2023FCFSIllustration shows total head movement of 640 cylinders.6 3/17/2023SSTFlSelects the request with the minimum seek time from the current head position.lSSTF scheduling is a form of SJF scheduling;may cause starvation of
8、some requests.lIllustration shows total head movement of 236 cylinders.7 3/17/2023SSTF(Cont.)8 3/17/2023SCANlThe 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 conti
9、nues.lSometimes called the elevator algorithm(电梯算法).lIllustration shows total head movement of 208 cylinders.9 3/17/2023SCAN(Cont.)10 3/17/2023C-SCANlProvides a more uniform wait time than SCAN.lThe head moves from one end of the disk to the other.servicing requests as it goes.When it reaches the ot
10、her end,however,it immediately returns to the beginning of the disk,without servicing any requests on the return trip.lTreats the cylinders as a circular list that wraps around from the last cylinder to the first one.11 3/17/2023C-SCAN(Cont.)12 3/17/2023C-LOOKlVersion of C-SCANlArm only goes as far
11、as the last request in each direction,then reverses direction immediately,without first going all the way to the end of the disk.13 3/17/2023C-LOOK(Cont.)14 3/17/2023Selecting a Disk-Scheduling AlgorithmlSSTF is common and has a natural appeallSCAN and C-SCAN perform better for systems that place a
12、heavy load on the disk.lPerformance depends on the number and types of requests.lRequests for disk service can be influenced by the file-allocation method.lThe disk-scheduling algorithm should be written as a separate module of the operating system,allowing it to be replaced with a different algorit
13、hm if necessary.lEither SSTF or LOOK is a reasonable choice for the default algorithm.15 3/17/2023Disk ManagementlLow-level formatting,or physical formatting Dividing a disk into sectors that the disk controller can read and write.lTo use a disk to hold files,the operating system still needs to reco
14、rd its own data structures on the disk.nPartition the disk into one or more groups of cylinders.nLogical formatting or“making a file system”.lBoot block initializes system.nThe bootstrap is stored in ROM.nBootstrap loader program.lMethods such as sector sparing used to handle bad blocks.16 3/17/2023
15、MS-DOS Disk Layout 17 3/17/2023Swap-Space ManagementlSwap-space Virtual memory uses disk space as an extension of main memory.lSwap-space can be carved out of the normal file system,or,more commonly,it can be in a separate disk partition.lSwap-space managementn4.3BSD allocates swap space when proces
16、s starts;holds text segment(the program)and data segment.nKernel uses swap maps to track swap-space use.nSolaris 2 allocates swap space only when a page is forced out of physical memory,not when the virtual memory page is first created.18 3/17/20234.3 BSD Text-Segment Swap Map 19 3/17/20234.3 BSD Da
17、ta-Segment Swap Map 20 3/17/2023RAID StructurelRAID multiple disk drives provides reliability via redundancy.lRAID is arranged into six different levels.21 3/17/2023RAID(cont)lSeveral improvements in disk-use techniques involve the use of multiple disks working cooperatively.lDisk striping uses a gr
18、oup of disks as one storage unit.lRAID schemes improve performance and improve the reliability of the storage system by storing redundant data.nMirroring or shadowing keeps duplicate of each disk.nBlock interleaved parity uses much less redundancy.22 3/17/2023RAID Levels 23 3/17/2023RAID(0+1)and(1+0
19、)24 3/17/2023Disk AttachmentlDisks may be attached one of two ways:1.Host attached via an I/O port2.Network attached via a network connection 25 3/17/2023Network-Attached Storage 26 3/17/2023Storage-Area Network 27 3/17/2023Stable-Storage ImplementationlWrite-ahead log scheme requires stable storage
20、.lTo implement stable storage:nReplicate information on more than one nonvolatile storage media with independent failure modes.nUpdate information in a controlled manner to ensure that we can recover the stable data after any failure during data transfer or recovery.28 3/17/2023Tertiary Storage Devi
21、ceslLow cost is the defining characteristic of tertiary storage.lGenerally,tertiary storage is built using removable medialCommon examples of removable media are floppy disks and CD-ROMs;other types are available.29 3/17/2023Removable DiskslFloppy disk thin flexible disk coated with magnetic materia
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 精选 操作系统 责任 高效 使用 硬件 对于 磁盘 设备 5305
限制150内