您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 咨询培训 > 计算机操作系统原理13
wency@cuit.edu.cn201013.1OperatingSystemConceptsChapter13:Mass-StorageSystemsDiskStructureDiskSchedulingDiskManagementSwap-SpaceManagementTertiaryStorageDevicesOperatingSystemIssuesPerformanceIssueswency@cuit.edu.cn201013.2OperatingSystemConcepts13.1DiskStructureDiskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer.Thesizeoflogicalblockis512bytes,whichcanbechooseadifferentsizewhendoinglow-levelformatting.The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially.Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder.Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost.wency@cuit.edu.cn201013.3OperatingSystemConcepts13.1DiskStructure(2)Thenumberofsectorspertrackhasbeenincreasingasdisktechnologyimproves,andtheouterzoneofadiskusuallyhasseveralhundredsectorspertrack.Thenumberofcylindersperdiskhasbeenincreasing;largediskhastensofthousandsofcylinders.wency@cuit.edu.cn201013.4OperatingSystemConcepts13.1DiskStructure(2)Moving-HeadDiskMechanismwency@cuit.edu.cn201013.5OperatingSystemConcepts13.2DiskSchedulingOperatingsystemisresponsibleforusinghardwareefficiently—forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth.Accesstime--hastwomajorcomponentsSeektime--thetimeforthediskarmtomovetheheadstothecylindercontainingthedesiredsector.Rotationallatency--theadditionaltimewaitingforthedisktorotatethedesiredsectortothediskhead.Diskbandwidth--thetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer.wency@cuit.edu.cn201013.6OperatingSystemConcepts13.2DiskScheduling(1)ByschedulingtheserviceofdiskI/Orequestsinagoodorder,wecanminimizeseektime.SeektimeseekdistanceSeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests.Weillustratethemwitharequestqueue(0-199).98,183,37,122,14,124,65,67Headpointer53wency@cuit.edu.cn201013.7OperatingSystemConcepts13.2.1FCFSSchedulingFCFS–thesimplestoneandisintrinsicallyfair,butgenerallydoesnotprovidethefastestservice.Illustrationshowstotalheadmovementof640cylinders.wency@cuit.edu.cn201013.8OperatingSystemConcepts13.2.2SSTFSchedulingSSTF(shortest-seek-time-first)--Selectstherequestwiththeminimumseektimefromthecurrentheadposition.SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests.SSTFalgorithmisasubstantialimprovementovertheFCFS,butitisnotoptimal.illustrationshowsatotalheadmovementofonly236cylinders(208ispossible?)–littlemorethanone-thirdofthedistanceneededforFCFSschedulingofthisrequestqueue.wency@cuit.edu.cn201013.9OperatingSystemConcepts13.2.2SSTFScheduling(1)wency@cuit.edu.cn201013.10OperatingSystemConcepts13.2.3SCANSchedulingSCAN--diskarmstartsatoneendofthedisk,andmovestowardtheotherend,servicingrequestsalongthewayuntilitgetstotheotherendofthedisk,wheretheheadmovementisreversedandservicingcontinues.Sometimescalledelevatoralgorithm,sincediskarmbehavesjustlikeanelevatorinabuilding,firstservingalltherequestsgoingup,andthenreversingtoservicerequeststheotherway.WithSCAN,needtoknowthedirectionofheadmovement,inadditiontothehead’scurrentposition.Illustrationshowsatotalheadmovementof236cylinders.wency@cuit.edu.cn201013.11OperatingSystemConcepts13.2.3SCANScheduling(1)Assumethediskarmismovingtoward0.wency@cuit.edu.cn201013.12OperatingSystemConcepts13.2.4C-SCANSchedulingC-SCAN(CircularSCAN)isavariantofSCANdesignedtoprovideamoreuniformwaittimethanSCAN.C-SCAN--headmovesfromoneendofthedisktotheother,servicingrequestsasitgoes.Whenreachingtheotherend,however,itreturnstothebeginningofthediskimmediately,withoutservicinganyrequestsonthereturntrip.Treatsthecylindersasacircularlistthatwrapsaroundfromthelastcylindertothefirstone.uniformn.制服adj.统一的,相同的,一致的,始终如一的,均衡的vt.使成一样,使穿制服wency@cuit.edu.cn201013.13OperatingSystemConcepts13.2.4C-SCANScheduling(1)wency@cuit.edu.cn201013.14OperatingSystemConcepts13.2.5C-LOOKSchedulingC-LOOKisaversionofC-SCAN(alsoLookisversionofSCAN),becauseitlookforarequestbeforecontinuingtomoveinagivendirection.C-LOOK--Armonlygoesasfarasthelastrequestineachdirection,thenreversesdirectionimmediately,withoutgoingallthewaytotheendofthedisk.wency@cuit.edu.cn201013.15OperatingSystemConcepts13.2.5C-LOOKScheduling(1)wency@cuit.edu.cn201013.16OperatingSystemConcepts13.2.6SelectingaDisk-SchedulingAlgorithmSSTFiscommonandhasanaturalappeal.SCANandC-SCANperformbetterforsystemsthatplaceaheavyloadonthedisk--lesslikelyhaveastarvationproblem.Performancedependsheavilyonthenumberandtypesofrequestswithanyschedulingalgorithms.Requestsfordiskservicecanbeinfluencedbythefile-allocationmethod(contiguous,linkedorindexed).Thedisk-schedulingalgorithmshouldbewrittenasaseparatemoduleoftheoperatingsystem,allowingittobereplacedwithadifferentalgorithmifnecessary.EitherSSTForLOOKisareasonablechoiceforthedefaultalgorithm.wency@cuit.edu.cn201013.17OperatingSystemConcepts13.3DiskManagementOperatingsystemisrespon
本文标题:计算机操作系统原理13
链接地址:https://www.777doc.com/doc-5263253 .html