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