




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Chapter14:Mass-StorageSystemsDiskStructureDiskSchedulingDiskManagementSwap-SpaceManagementRAIDStructureDiskAttachmentStable-StorageImplementationTertiaryStorageDevicesOperatingSystemIssuesPerformanceIssues 1 4/11/第1页DiskStructureDiskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer.
The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially.Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder.Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost. 2 4/11/第2页DiskSchedulingTheoperatingsystemisresponsibleforusinghardwareefficiently—forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth.
操作系统有责任高效地使用硬件——对于磁盘设备,这意味着很短访问时间和磁盘带宽。Accesstimehastwomajorcomponents访问时间包含两个主要部分Seektimeisthetimeforthediskaretomovetheheadstothecylindercontainingthedesiredsector.寻道时间是指把磁头移到所需柱面时间。Rotationallatencyistheadditionaltimewaitingforthedisktorotatethedesiredsectortothediskhead.旋转延迟是指等候磁盘上所需要扇区旋转到磁头下面时间。 3 4/11/第3页DiskSchedulingMinimizeseektime最小寻道时间Seektimeseekdistance寻道时间
寻道距离Diskbandwidthisthetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer.
磁盘带宽,是用传输总位数,除以第一个服务请求与最终传输完成之间总时间。 4 4/11/第4页DiskScheduling(Cont.)SeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests.Weillustratethemwitharequestqueue(0-199).
98,183,37,122,14,124,65,67 Headpointer53 5 4/11/第5页FCFSIllustrationshowstotalheadmovementof640cylinders. 6 4/11/第6页SSTFSelectstherequestwiththeminimumseektimefromthecurrentheadposition.SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests.Illustrationshowstotalheadmovementof236cylinders. 7 4/11/第7页SSTF(Cont.) 8 4/11/第8页SCANThediskarmstartsatoneendofthedisk,andmovestowardtheotherend,servicingrequestsuntilitgetstotheotherendofthedisk,wheretheheadmovementisreversedandservicingcontinues.Sometimescalledtheelevatoralgorithm(电梯算法).Illustrationshowstotalheadmovementof208cylinders. 9 4/11/第9页SCAN(Cont.) 10 4/11/第10页C-SCANProvidesamoreuniformwaittimethanSCAN.Theheadmovesfromoneendofthedisktotheother.servicingrequestsasitgoes.Whenitreachestheotherend,however,itimmediatelyreturnstothebeginningofthedisk,withoutservicinganyrequestsonthereturntrip.Treatsthecylindersasacircularlistthatwrapsaroundfromthelastcylindertothefirstone. 11 4/11/第11页C-SCAN(Cont.) 12 4/11/第12页C-LOOKVersionofC-SCANArmonlygoesasfarasthelastrequestineachdirection,thenreversesdirectionimmediately,withoutfirstgoingallthewaytotheendofthedisk. 13 4/11/第13页C-LOOK(Cont.) 14 4/11/第14页SelectingaDisk-SchedulingAlgorithmSSTFiscommonandhasanaturalappealSCANandC-SCANperformbetterforsystemsthatplaceaheavyloadonthedisk.Performancedependsonthenumberandtypesofrequests.Requestsfordiskservicecanbeinfluencedbythefile-allocationmethod.Thedisk-schedulingalgorithmshouldbewrittenasaseparatemoduleoftheoperatingsystem,allowingittobereplacedwithadifferentalgorithmifnecessary.EitherSSTForLOOKisareasonablechoiceforthedefaultalgorithm. 15 4/11/第15页DiskManagementLow-levelformatting,orphysicalformatting—Dividingadiskintosectorsthatthediskcontrollercanreadandwrite.Touseadisktoholdfiles,theoperatingsystemstillneedstorecorditsowndatastructuresonthedisk.Partitionthediskintooneormoregroupsofcylinders.Logicalformattingor“makingafilesystem”.Bootblockinitializessystem.ThebootstrapisstoredinROM.Bootstraploaderprogram.Methodssuchassectorsparingusedtohandlebadblocks. 16 4/11/第16页MS-DOSDiskLayout 17 4/11/第17页Swap-SpaceManagementSwap-space—Virtualmemoryusesdiskspaceasanextensionofmainmemory.Swap-spacecanbecarvedoutofthenormalfilesystem,or,morecommonly,itcanbeinaseparatediskpartition.Swap-spacemanagement4.3BSDallocatesswapspacewhenprocessstarts;holdstextsegment(theprogram)anddatasegment.Kernelusesswapmapstotrackswap-spaceuse.Solaris2allocatesswapspaceonlywhenapageisforcedoutofphysicalmemory,notwhenthevirtualmemorypageisfirstcreated. 18 4/11/第18页4.3BSDText-SegmentSwapMap 19 4/11/第19页4.3BSDData-SegmentSwapMap 20 4/11/第20页RAIDStructureRAID–multiplediskdrivesprovidesreliabilityviaredundancy.RAIDisarrangedintosixdifferentlevels. 21 4/11/第21页RAID(cont)Severalimprovementsindisk-usetechniquesinvolvetheuseofmultipledisksworkingcooperatively.
Diskstripingusesagroupofdisksasonestorageunit.
RAIDschemesimproveperformanceandimprovethereliabilityofthestoragesystembystoringredundantdata.Mirroringorshadowingkeepsduplicateofeachdisk.Blockinterleavedparityusesmuchlessredundancy. 22 4/11/第22页RAIDLevels 23 4/11/第23页RAID(0+1)and(1+0) 24 4/11/第24页DiskAttachmentDisksmaybeattachedoneoftwoways:HostattachedviaanI/OportNetworkattachedviaanetworkconnection 25 4/11/第25页Network-AttachedStorage 26 4/11/第26页Storage-AreaNetwork 27 4/11/第27页Stable-StorageImplementationWrite-aheadlogschemerequiresstablestorage.
Toimplementstablestorage:Replicateinformationonmorethanonenonvolatilestoragemediawithindependentfailuremodes.Updateinformationinacontrolledmannertoensurethatwecanrecoverthestabledataafteranyfailureduringdatatransferorrecovery. 28 4/11/第28页TertiaryStorageDevicesLowcostisthedefiningcharacteristicoftertiarystorage.
Generally,tertiarystorageisbuiltusingremovablemedia
CommonexamplesofremovablemediaarefloppydisksandCD-ROMs;othertypesareavailable. 29 4/11/第29页RemovableDisksFloppydisk—thinflexiblediskcoatedwithmagneticmaterial,enclosedinaprotectiveplasticcase.
Mostfloppiesholdabout1MB;similartechnologyisusedforremovabledisksthatholdmorethan1GB.Removablemagneticdiskscanbenearlyasfastasharddisks,buttheyareatagreaterriskofdamagefromexposure. 30 4/11/第30页RemovableDisks(Cont.)Amagneto-opticdiskrecordsdataonarigidplattercoatedwithmagneticmaterial.Laserheatisusedtoamplifyalarge,weakmagneticfieldtorecordabit.Laserlightisalsousedtoreaddata(Kerreffect).Themagneto-opticheadfliesmuchfartherfromthedisksurfacethanamagneticdiskhead,andthemagneticmaterialiscoveredwithaprotectivelayerofplasticorglass;resistanttoheadcrashes.
Opticaldisksdonotusemagnetism;theyemployspecialmaterialsthatarealteredbylaserlight. 31 4/11/第31页WORMDisksThedataonread-writediskscanbemodifiedoverandover.WORM(“WriteOnce,ReadManyTimes”)diskscanbewrittenonlyonce.Thinaluminumfilmsandwichedbetweentwoglassorplasticplatters.Towriteabit,thedriveusesalaserlighttoburnasmallholethroughthealuminum;informationcanbedestroyedbynotaltered.Verydurableandreliable.ReadOnlydisks,suchadCD-ROMandDVD,comfromthefactorywiththedatapre-recorded. 32 4/11/第32页TapesComparedtoadisk,atapeislessexpensiveandholdsmoredata,butrandomaccessismuchslower.Tapeisaneconomicalmediumforpurposesthatdonotrequirefastrandomaccess,e.g.,backupcopiesofdiskdata,holdinghugevolumesofdata.Largetapeinstallationstypicallyuserobotictapechangersthatmovetapesbetweentapedrivesandstorageslotsinatapelibrary.stacker–librarythatholdsafewtapessilo–librarythatholdsthousandsoftapesAdisk-residentfilecanbearchivedtotapeforlowcoststorage;thecomputercanstageitbackintodiskstorageforactiveuse. 33 4/11/第33页OperatingSystemIssuesMajorOSjobsaretomanagephysicaldevicesandtopresentavirtualmachineabstractiontoapplications
Forharddisks,theOSprovidestwoabstraction:Rawdevice–anarrayofdatablocks.Filesystem–theOSqueuesandschedulestheinterleavedrequestsfromseveralapplications. 34 4/11/第34页ApplicationInterfaceMostOSshandleremovabledisksalmostexactlylikefixeddisks—anewcartridgeisformattedandanemptyfilesystemisgeneratedonthedisk.Tapesarepresentedasarawstoragemedium,i.e.,andapplicationdoesnotnotopenafileonthetape,itopensthewholetapedriveasarawdevice.Usuallythetapedriveisreservedfortheexclusiveuseofthatapplication.SincetheOSdoesnotprovidefilesystemservices,theapplicationmustdecidehowtousethearrayofblocks.Sinceeveryapplicationmakesupitsownrulesforhowtoorganizeatape,atapefullofdatacangenerallyonlybeusedbytheprogramthatcreatedit. 35 4/11/第35页TapeDrivesThebasicoperationsforatapedrivedifferfromthoseofadiskdrive.locatepositionsthetapetoaspecificlogicalblock,notanentiretrack(correspondstoseek).Thereadpositionoperationreturnsthelogicalblocknumberwherethetapeheadis.Thespaceoperationenablesrelativemotion.Tapedrivesare“append-only”devices;updatingablockinthemiddleofthetapealsoeffectivelyeraseseverythingbeyondthatblock.AnEOTmarkisplacedafterablockthatiswritten. 36 4/11/第36页FileNamingTheissueofnamingfilesonremovablemediaisespeciallydifficultwhenwewanttowritedataonaremovablecartridgeononecomputer,andthenusethecartridgeinanothercomputer.ContemporaryOSsgenerallyleavethenamespaceproblemunsolvedforremovablemedia,anddependonapplicationsanduserstofigureouthowtoaccessandinterpretthedata.Somekindsofremovablemedia(e.g.,CDs)aresowellstandardizedthatallcomputersusethemthesameway. 37 4/11/第37页HierarchicalStorageManagement(HSM)Ahierarchicalstoragesystemextendsthestoragehierarchybeyondprimarymemoryandsecondarystoragetoincorporatetertiarystorage—usuallyimplementedasajukeboxoftapesorremovabledisks.Usuallyincorporatetertiarystoragebyextendingthefilesystem.Smallandfrequentlyusedfilesremainondisk.Large,old,inactivefilesarearchivedtothejukebox.HSMisusuallyfoundinsupercomputingcentersandotherlargeinstallationsthathaveenormousvolumesofdata. 38 4/11/第38页SpeedTwoaspectsofspeedintertiarystoragearebandwidthandlatency.
Bandwidthismeasuredinbytespersecond.Sustainedbandwidth–averagedatarateduringalargetransfer;#ofbytes/transfertime.
Dataratewhenthedatastreamisactuallyflowing.Effectivebandwidth–averageovertheentireI/Otime,includingseekorlocate,andcartridgeswitching.
Drive’soveralldatarate. 39 4/11/第39页Speed(Cont.)Accesslatency–amountoftimeneededtolocatedata.Accesstimeforadisk–movethearmtotheselectedcylinderandwaitfortherotationallatency;<35milliseconds.Accessontaperequireswindingthetapereelsuntiltheselectedblockreachesthetapehead;tensorhundredsofseconds.Generallysaythatrandomaccesswithinatapecartridgeisaboutathousandtimesslowerthanrandomaccessondisk.T
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公司月度奖惩活动方案
- 公司消防比赛活动方案
- 公司盆栽种植活动方案
- 公司相亲对象活动方案
- 公司规模科普活动方案
- 公司现场招聘会策划方案
- 公司组织温泉玩活动方案
- 公司活动方案奖励方案
- 公司行政生日会策划方案
- 公司教育活动策划方案
- 2025年广东省广州市南沙区中考二模道德与法治试题
- 2025届重庆市普通高中学业水平选择性考试预测历史试题(含答案)
- 2025-2030中国眼底照相机行业市场发展趋势与前景展望战略研究报告
- 2024年深圳市大鹏新区区属公办中小学招聘教师真题
- 人教版小学语文四年级下册作文范文2
- 大学语文试题及答案琴
- 红十字会资产管理制度
- T/CSPSTC 112-2023氢气管道工程施工技术规范
- 2025届四川成都锦江区数学七下期末质量检测试题含解析
- 无人机飞行器结构与性能试题及答案
- 《蔚来汽车》课件
评论
0/150
提交评论