您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 操作系统有责任高效地使用硬件对于磁盘设备概要
12/18/2020Chapter14:Mass-StorageSystemsDiskStructureDiskSchedulingDiskManagementSwap-SpaceManagementRAIDStructureDiskAttachmentStable-StorageImplementationTertiaryStorageDevicesOperatingSystemIssuesPerformanceIssues22/18/2020DiskStructureDiskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer.The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially.Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder.Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost.32/18/2020DiskSchedulingTheoperatingsystemisresponsibleforusinghardwareefficiently—forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth.操作系统有责任高效地使用硬件——对于磁盘设备,这意味着很短的访问时间和磁盘带宽。Accesstimehastwomajorcomponents访问时间包括两个主要部分Seektimeisthetimeforthediskaretomovetheheadstothecylindercontainingthedesiredsector.寻道时间是指把磁头移到所需柱面的时间。Rotationallatencyistheadditionaltimewaitingforthedisktorotatethedesiredsectortothediskhead.旋转延迟是指等待磁盘上所需要的扇区旋转到磁头下面的时间。42/18/2020DiskSchedulingMinimizeseektime最小寻道时间Seektimeseekdistance寻道时间寻道距离Diskbandwidthisthetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer.磁盘带宽,是用传输的总位数,除以第一个服务请求与最后传输完成之间的总时间。52/18/2020DiskScheduling(Cont.)SeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests.Weillustratethemwitharequestqueue(0-199).98,183,37,122,14,124,65,67Headpointer5362/18/2020FCFSIllustrationshowstotalheadmovementof640cylinders.72/18/2020SSTFSelectstherequestwiththeminimumseektimefromthecurrentheadposition.SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests.Illustrationshowstotalheadmovementof236cylinders.82/18/2020SSTF(Cont.)92/18/2020SCANThediskarmstartsatoneendofthedisk,andmovestowardtheotherend,servicingrequestsuntilitgetstotheotherendofthedisk,wheretheheadmovementisreversedandservicingcontinues.Sometimescalledtheelevatoralgorithm(电梯算法).Illustrationshowstotalheadmovementof208cylinders.102/18/2020SCAN(Cont.)112/18/2020C-SCANProvidesamoreuniformwaittimethanSCAN.Theheadmovesfromoneendofthedisktotheother.servicingrequestsasitgoes.Whenitreachestheotherend,however,itimmediatelyreturnstothebeginningofthedisk,withoutservicinganyrequestsonthereturntrip.Treatsthecylindersasacircularlistthatwrapsaroundfromthelastcylindertothefirstone.122/18/2020C-SCAN(Cont.)132/18/2020C-LOOKVersionofC-SCANArmonlygoesasfarasthelastrequestineachdirection,thenreversesdirectionimmediately,withoutfirstgoingallthewaytotheendofthedisk.142/18/2020C-LOOK(Cont.)152/18/2020SelectingaDisk-SchedulingAlgorithmSSTFiscommonandhasanaturalappealSCANandC-SCANperformbetterforsystemsthatplaceaheavyloadonthedisk.Performancedependsonthenumberandtypesofrequests.Requestsfordiskservicecanbeinfluencedbythefile-allocationmethod.Thedisk-schedulingalgorithmshouldbewrittenasaseparatemoduleoftheoperatingsystem,allowingittobereplacedwithadifferentalgorithmifnecessary.EitherSSTForLOOKisareasonablechoiceforthedefaultalgorithm.162/18/2020DiskManagementLow-levelformatting,orphysicalformatting—Dividingadiskintosectorsthatthediskcontrollercanreadandwrite.Touseadisktoholdfiles,theoperatingsystemstillneedstorecorditsowndatastructuresonthedisk.Partitionthediskintooneormoregroupsofcylinders.Logicalformattingor“makingafilesystem”.Bootblockinitializessystem.ThebootstrapisstoredinROM.Bootstraploaderprogram.Methodssuchassectorsparingusedtohandlebadblocks.172/18/2020MS-DOSDiskLayout182/18/2020Swap-SpaceManagementSwap-space—Virtualmemoryusesdiskspaceasanextensionofmainmemory.Swap-spacecanbecarvedoutofthenormalfilesystem,or,morecommonly,itcanbeinaseparatediskpartition.Swap-spacemanagement4.3BSDallocatesswapspacewhenprocessstarts;holdstextsegment(theprogram)anddatasegment.Kernelusesswapmapstotrackswap-spaceuse.Solaris2allocatesswapspaceonlywhenapageisforcedoutofphysicalmemory,notwhenthevirtualmemorypageisfirstcreated.192/18/20204.3BSDText-SegmentSwapMap202/18/20204.3BSDData-SegmentSwapMap212/18/2020RAIDStructureRAID–multiplediskdrivesprovidesreliabilityviaredundancy.RAIDisarrangedintosixdifferentlevels.222/18/2020RAID(cont)Severalimprovementsindisk-usetechniquesinvolvetheuseofmultipledisksworkingcooperatively.Diskstripingusesagroupofdisksasonestorageunit.RAIDschemesimproveperformanceandimprovethereliabilityofthestoragesystembystoringredundantdata.Mirroringorshadowingkeepsduplicateofeachdisk.Blockinterleavedparityusesmuchlessredundancy.232/18/2020RAIDLevels242/18/2020RAID(0+1)and(1+0)252/18/2020DiskAttachmentDisksmaybeattachedoneoftwoways:1.HostattachedviaanI/Oport2.Networkattachedviaanetworkconnection262/18/2020Network-AttachedStorage272/18/2020Storage-AreaNetwork282/18/2020Stable-StorageImplementationWrite-aheadlogschemerequiresstablestorage.Toimplementstablestorage:Replicateinformationonmorethanonenonvolatilestoragemediawithindependentfailuremodes.Updateinformationinacontrolledmannertoen
本文标题:操作系统有责任高效地使用硬件对于磁盘设备概要
链接地址:https://www.777doc.com/doc-3874801 .html