已阅读5页,还剩37页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Chapter13:Mass-StorageSystems,DiskStructureDiskSchedulingDiskManagementSwap-SpaceManagementTertiaryStorageDevicesOperatingSystemIssuesPerformanceIssues,OperatingSystemConcepts,13.1DiskStructure,Diskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer.Thesizeoflogicalblockis512bytes,whichcanbechooseadifferentsizewhendoinglow-levelformatting.The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially.Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder.Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost.,OperatingSystemConcepts,13.1DiskStructure(2),Thenumberofsectorspertrackhasbeenincreasingasdisktechnologyimproves,andtheouterzoneofadiskusuallyhasseveralhundredsectorspertrack.Thenumberofcylindersperdiskhasbeenincreasing;largediskhastensofthousandsofcylinders.,OperatingSystemConcepts,13.1DiskStructure(2),Moving-HeadDiskMechanism,OperatingSystemConcepts,13.2DiskScheduling,Operatingsystemisresponsibleforusinghardwareefficientlyforthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth.Accesstime-hastwomajorcomponentsSeektime-thetimeforthediskarmtomovetheheadstothecylindercontainingthedesiredsector.Rotationallatency-theadditionaltimewaitingforthedisktorotatethedesiredsectortothediskhead.Diskbandwidth-thetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer.,OperatingSystemConcepts,13.2DiskScheduling(1),ByschedulingtheserviceofdiskI/Orequestsinagoodorder,wecanminimizeseektime.SeektimeseekdistanceSeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests.Weillustratethemwitharequestqueue(0-199).98,183,37,122,14,124,65,67Headpointer53,OperatingSystemConcepts,13.2.1FCFSScheduling,FCFSthesimplestoneandisintrinsicallyfair,butgenerallydoesnotprovidethefastestservice.Illustrationshowstotalheadmovementof640cylinders.,OperatingSystemConcepts,13.2.2SSTFScheduling,SSTF(shortest-seek-time-first)-Selectstherequestwiththeminimumseektimefromthecurrentheadposition.SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests.SSTFalgorithmisasubstantialimprovementovertheFCFS,butitisnotoptimal.illustrationshowsatotalheadmovementofonly236cylinders(208ispossible?)littlemorethanone-thirdofthedistanceneededforFCFSschedulingofthisrequestqueue.,OperatingSystemConcepts,OperatingSystemConcepts,13.2.2SSTFScheduling(1),13.2.3SCANScheduling,SCAN-diskarmstartsatoneendofthedisk,andmovestowardtheotherend,servicingrequestsalongthewayuntilitgetstotheotherendofthedisk,wheretheheadmovementisreversedandservicingcontinues.Sometimescalledelevatoralgorithm,sincediskarmbehavesjustlikeanelevatorinabuilding,firstservingalltherequestsgoingup,andthenreversingtoservicerequeststheotherway.WithSCAN,needtoknowthedirectionofheadmovement,inadditiontotheheadscurrentposition.Illustrationshowsatotalheadmovementof236cylinders.,OperatingSystemConcepts,13.2.3SCANScheduling(1),Assumethediskarmismovingtoward0.,OperatingSystemConcepts,13.2.4C-SCANScheduling,C-SCAN(CircularSCAN)isavariantofSCANdesignedtoprovideamoreuniformwaittimethanSCAN.C-SCAN-headmovesfromoneendofthedisktotheother,servicingrequestsasitgoes.Whenreachingtheotherend,however,itreturnstothebeginningofthediskimmediately,withoutservicinganyrequestsonthereturntrip.Treatsthecylindersasacircularlistthatwrapsaroundfromthelastcylindertothefirstone.,uniformn.制服adj.统一的,相同的,一致的,始终如一的,均衡的vt.使成一样,使穿制服,OperatingSystemConcepts,OperatingSystemConcepts,13.2.4C-SCANScheduling(1),13.2.5C-LOOKScheduling,C-LOOKisaversionofC-SCAN(alsoLookisversionofSCAN),becauseitlookforarequestbeforecontinuingtomoveinagivendirection.C-LOOK-Armonlygoesasfarasthelastrequestineachdirection,thenreversesdirectionimmediately,withoutgoingallthewaytotheendofthedisk.,OperatingSystemConcepts,OperatingSystemConcepts,13.2.5C-LOOKScheduling(1),13.2.6SelectingaDisk-SchedulingAlgorithm,SSTFiscommonandhasanaturalappeal.SCANandC-SCANperformbetterforsystemsthatplaceaheavyloadonthedisk-lesslikelyhaveastarvationproblem.Performancedependsheavilyonthenumberandtypesofrequestswithanyschedulingalgorithms.Requestsfordiskservicecanbeinfluencedbythefile-allocationmethod(contiguous,linkedorindexed).Thedisk-schedulingalgorithmshouldbewrittenasaseparatemoduleoftheoperatingsystem,allowingittobereplacedwithadifferentalgorithmifnecessary.EitherSSTForLOOKisareasonablechoiceforthedefaultalgorithm.,OperatingSystemConcepts,13.3DiskManagement,Operatingsystemisresponsibleforseveralotheraspectsofdiskmanagement,too.SuchasDiskinitializationBootingfromdiskBad-blockrecovery,OperatingSystemConcepts,13.3.1DiskFormatting,Low-levelformatting(physicalformatting)divideadiskintosectorsthatthediskcontrollercanreadandwrite.fillsthediskwithaspecialdatastructureforeachsector,typicallyconsistingofaheader,adataareaandatrailer.Mostharddisksarelow-levelformattedatthefactoryasapartofthemanufacturingprocess.Touseadisktoholdfiles,operatingsystemstillneedstorecorditsowndatastructuresonthedisk.First,partitiondiskintooneormoregroupsofcylinders.Second,Logicalformattingor“makingafilesystem”.Thesedatastructuresmayincludemapsoffreeandallocatedspace(aFATorinodes)andaninitialemptydirectory.,OperatingSystemConcepts,13.3.2BootBlock,Bootstrapaprogramusedtoinitializeallaspectsofthesystem,fromCPUregisterstodevicecontrollersandthecontentsofmainmemory,andthenstartsOS.Todoitsjob,bootstrapfindstheOSkernelondisk,loadsthatkernelintomemory,andjumpstoaninitialaddresstobegintheoperatingsystemexecution.Formostcomputers,bootstrapisstoredinROM,butnoteasytomodify.So,mostsystemsstoreatinybootstraploaderprograminthebootROM,whoseonlyjobistobringinafullbootstrapprogramformdisk.Thefullbootstrapisstoredinbootblock.BootBlocktheblockusedtostorethefullbootstrap,whichisatafixedlocationonthedisk.Adiskhavingabootpartitioniscalledbootdiskorsystemdisk.,OperatingSystemConcepts,13.3.2BootBlock(1),MS-DOSDiskLayoutusesone512-byteblockforitsbootprogram,OperatingSystemConcepts,13.3.3BadBlocks,Frequently,diskshaveoneormoresectorstobecomedefective,andevencomfromthefactorywithbadblocks.Dependingondiskandcontrollerinuse,badblocksarehandledinavarietyofways.Onsimpledisks,suchasdiskswithIDEcontrollers,badblocksarehandledmanually.(formatcommand)Moresophisticateddisks,suchasSCSIdisksusedinhigh-endPCsandmostworkstationsandservers,aresmarteraboutbad-blockrecovery.controllermaintainsalistofbadblocksondisk,whichisinitializedduringlow-levelformatandisupdatedoverthelifeofdisk.Low-levelformattingalsosetsasidesparesectorsnotvisibletoOS.Controllercanbetoldtoreplaceeachbadsectorlogicallywithoneofthesparesectors.Thisschemeisknownassectorsparing.Somecontrollerscanbeinstructedtoreplaceabadblockbysectorslippinginsteadofsectorsparing.,OperatingSystemConcepts,13.4Swap-SpaceManagement,Swap-spaceVirtualmemoryusesdiskspaceasanextensionofmainmemory.Maingoal-toprovidethebestthroughputforthevirtual-memorysystem.SwapspaceisusedinvariouswaysbydifferentOS,dependingonthememory-managementalgorithmsused.Systemswithswappingmayuseswapspacetoholdtheentireprocessimage,includingcodeanddatasegments.Pagingsystemsmaysimplystorepagesthathavebeenpushedoutofmemory.Theamountofswapspaceneededcanvarydependingontheamountofphysicalmemory,theamountofvirtualmemoryitisbacking,andthewayinwhichvirtualmemoryisused.SomeOS,suchasUNIX,allowtheuseofmultipleswapspaceswhichusuallyputonseparatedisks.,OperatingSystemConcepts,13.4Swap-SpaceManagement(1),Swap-spacecanresideintwoplaces:Canbecarvedoutofthenormalfilesystem.Infact,itssimplyalargefilewithinfilesystem,soitiseasytoimplement,butitisinefficient.Morecommonly,beinaseparatediskpartitionwithoutfilesystemordirectorystructure.Aseparatemanagerisusedtoallocateanddeallocatetheblocks.Needtocreateafixedamountofswapspaceduringdiskpartitioning.Addingmoreswapspacecanbedoneonlyviarepartitioningofdisk,orviaaddinganotherswapspaceelsewhere.Swap-spacemanagement4.3BSDallocatesswapspacewhenprocessstartstoholdtextsegment(theprogram)anddatasegment.Kernelusestwoswapmapstotrackswap-spaceuse.Solaris2allocatesswapspaceonlywhenapageisforcedoutofphysicalmemory,notwhenvirtualmemorypageisfirstcreated.,OperatingSystemConcepts,13.4Swap-SpaceManagement(2),4.3BSDText-SegmentSwapMaptextsegmentisafixedsize,soitsswapspaceisallocatedin512KBchunks,exceptforthefinalchunk.,OperatingSystemConcepts,13.4Swap-SpaceManagement(3),4.3BSDData-SegmentSwapMapasdatasegmentcangrowovertime,themapisoffixedsize,butcontainsswapaddressesforblocksofvaryingsize.,OperatingSystemConcepts,13.5TertiaryStorageDevices,Lowcostisthedefiningcharacteristicoftertiarystorage.Generally,tertiarystorageisbuiltusingremovablemedia.ThemostcommonexamplesofremovablemediaarefloppydisksandCD-ROMs;othertypesareavailable.,OperatingSystemConcepts,13.5.1RemovableDisks,Floppydiskmadefromathinflexiblediskcoatedwithmagneticmaterial,enclosedinaprotectiveplasticcase.Mostfloppiesholdabout1MB;similartechnologyisusedforremovabledisksthatholdmorethan1GB.Removablemagneticdiskscanbenearlyasfastasharddisks,buttheyareatagreaterriskofdamagefromexposureeasytobescratched.,OperatingSystemConcepts,13.5.1RemovableDisks(1),magnetic-opticdisk-recordsdataonarigidplattercoatedwithmagneticmaterial,butrecordingtechnologyisquitedifferentfromthatformagneticdisk.Laserheatisusedtoamplifyalarge,weakmagneticfieldtorecordabit.Laserlightisalsousedtoreaddata(Kerreffect).Themagneto-opticheadfliesmuchfartherfromthedisksurfacethanamagneticdiskhead,andthemagneticmaterialiscoveredwithaprotectivelayerofplasticorglass;thismakesdiskmuchmoreresistanttoheadcrashes.Opticaldisk-donotusemagnetismatall;theyemployspecialmaterialsthatarealteredbylaserlight.Phase-changediskisoneexampleofoptical-disktechnology.Itiscoatedwithamaterialthatcanbefreezeintoeitheracrystallineoranamorphousstate.(re-recordableCD-RWandDVD-RW),OperatingSystemConcepts,13.5.1RemovableDisks(2),Read-writedisks-dataonread-writediskscanbemodifiedoverandover,suchasdisksdescribedabove.WORM(WriteOnce,ReadManyTimes)disks-canbewrittenonlyonce.Thinaluminumfilmsandwichedbetweentwoglassorplasticplatters.Towriteabit,driveusesalaserlighttoburnasmallholethroughthealuminum;informationcanbedestroyedbynotaltered.Verydurableandreliable.ReadOnlydisks-suchasCD-ROMandDVD,comefromthefactorywiththedatapre-recorded.TheyusetechnologysimilartothatofWORMdisks(althoughthepitsarepressed,notburnt),andtheyareverydurable.Mostremovabledisksareslowerthantheirnon-removablecounterparts.Thewritingprocessisslower,asarerotationandsometimesseektime.,OperatingSystemConcepts,13.5.2Tapes,Comparedtoadisk,atapeislessexpensiveandholdsmoredata,butrandomaccessismuchslower.Tapeisaneconomicalmediumforpurposesthatdonotrequirefastrandomaccess,e.g.,backupcopiesofdiskdata,holdinghugevolumesofdata.Largetapeinstallationstypicallyuserobotictapechangersthatmovetapesbetweentapedrivesandstorageslotsinatapelibrary.stackerlibrarythatholdsafewtapessilolibrarythatholdsthousandsoftapesAdisk-residentfilecanbearchivedtotapeforlowcoststorage;thecomputercanstageitbackintodiskstorageforactiveuse.,OperatingSystemConcepts,13.5.3OperatingSystemIssues,Majorjobsofoperatingsystemaretomanagephysicaldevicesandtopresentavirtualmachineabstractiontoapplications.Forharddisks,theoperatingsystemprovidestwoabstractions:Rawdevicejustanarrayofdatablocks.FilesystemtheOSqueuesandschedulestheinterleavedrequestsfromseveralapplications.,OperatingSystemConcepts,13.5.3.1ApplicationInterface,MostOSscanhandleremovabledisksalmostexactlylikefixeddisksanewcartridgemustbeformattedandthenanemptyfilesystemisgeneratedondisk.Tapesarepresentedasarawstoragemedium,i.e.,andapplicationdoesnotopenafileonthetape,itopensthewholetapedriveasarawdevice.Usuallythetapedriveisreservedfortheexclusiveuseofthatapplicationuntilitexitsorclosethetapdrive.SincetheOSdoesnotprovidefilesystemservices,theapplicationmustdecidehowtousethearrayofblocks.Sinceeveryapplicationmakesupitsownrulesforhowtoorganizeatape,atapefullofdatacangenerallyonlybeusedbytheprogramthatcreatedit.,OperatingSystemConcepts,13.5.3.1ApplicationInterface(1),Thebasicoperationsforatapedrivedifferfromthoseofadiskdrive.locatepositionsthetapetoaspecificlogicalblock,notanentiretrack(correspondstoseek).Thereadpositionoperationreturnsthelogicalblocknumberwherethetapeheadis.Thespaceoperationenablesrelativemotion.Tapedrivesare“append-only”devices;updatingablockinthemiddleoftapealsoeffectivelyeraseseverythingbeyondthatblock.AnEOTmarkisplacedafterablockthatiswritten.,OperatingSystemConcepts,13.5.3.2FileNaming,Theissueofnamingfilesonremovablemediaisespeciallydifficultwhenwewanttowritedataonaremovablecartridgeononecomputer,andthenusethecartridgeinanothercomputer.ContemporaryOSsgenerallyleavethenamespaceproblemunsolvedforremovablemedia,anddependonapplicationsanduserstofigureouthowtoaccessandinterpretthedata.Somekindsofremovablemedia(e.g.,CDs)aresowellstandardizedthatallcomputersusethemthesameway.DVDformatsarealsowellstandardized.,OperatingSystemConcepts,13.5.3.3HierarchicalStorageManagement(HSM),Ahierarchicalstoragesystemextendsthestoragehierarchybeyondprimarymemoryandsecondarystoragetoincorporatetertiarystorageusuallyimplementedasajukeboxoftapesorremovabledisks.Usuallyincorporatetertiarystoragebyextendingthefilesystem.Smallandfrequentlyusedfilesremainondisk.Large,old,inactivefilesarearchivedtothejukebox.HSMisusuallyfoundinsupercomputingcentersandotherlargeinstallationsthathaveenormousvolumesofdata.,Jukebox(自动)光盘机,点播机,自动电唱计,小型盒式盘带设备,Installation安装;装备置,设备;计算站中心,OperatingSystemConcepts,13.5.4PerformanceIssues,Aswithanycomponentofoperatingsystem,thethreemostimportaspectsoftertiary-storageperformancearespeed,reliability,andcost.Speedoftertiarystoragehastwoaspects-bandwidthandlatency.Bandwidth-measuredinbytespersecond.Sustainedbandwidthaveragedatarateduringalargetransfer(numberofbytes/transfertime).Dataratewhenthedatastreamisactuallyflowing.EffectivebandwidthaverageovertheentireI/Otime,includingseekorlocate,andcartridgeswitching.itsthedrivesoveralldatarate.,-Speed,Operating
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年智能交通行业智能交通系统建设与城市交通治理研究报告及未来发展趋势预测
- 2025年卫生健康行业数字健康管理平台用户需求调研与产品优化研究报告及未来发展趋势预测
- 2025年医疗健康行业智慧健康管理技术与服务模式研究报告及未来发展趋势预测
- 2025年移动支付行业支付技术与金融安全研究报告及未来发展趋势预测
- 2025年云计算行业云计算在企业信息化中的应用研究报告及未来发展趋势预测
- 2025年公共交通行业城市交通运输智能化发展研究报告及未来发展趋势预测
- 2025年社区服务行业社区数字化管理模式研究报告及未来发展趋势预测
- 2025年智慧能源行业绿色发展路径研究报告及未来发展趋势预测
- 2025年舞蹈行业虚拟舞蹈与舞蹈产业研究报告及未来发展趋势预测
- 2025年生物科技行业全球竞争力对比研究报告及未来发展趋势预测
- 全国“创新杯”电类说课大赛课件一等奖作品组合逻辑电路设计 (说课)
- 07887-平面设计与印刷工艺汇总
- 羽毛球基本功的学与练-教学实施报告(教师教学能力大赛)
- GB/T 879.1-2000弹性圆柱销直槽重型
- GB/T 670-1986化学试剂硝酸银
- GB/T 22901-2008纸和纸板透气度的测定(中等范围)通用方法
- GB/T 18915.2-2002镀膜玻璃第2部分:低辐射镀膜玻璃
- 2022年中小学教师职称评定答辩题
- FZ/T 01057.1-2007纺织纤维鉴别试验方法 第1部分:通用说明
- 设备的维护和维修的风险评估
- 国开病理生理学形考任务4试题及答案
评论
0/150
提交评论