操作系統(tǒng)有責任高效地使用硬件對于磁盤設(shè)備_第1頁
操作系統(tǒng)有責任高效地使用硬件對于磁盤設(shè)備_第2頁
操作系統(tǒng)有責任高效地使用硬件對于磁盤設(shè)備_第3頁
操作系統(tǒng)有責任高效地使用硬件對于磁盤設(shè)備_第4頁
操作系統(tǒng)有責任高效地使用硬件對于磁盤設(shè)備_第5頁
已閱讀5頁,還剩40頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

Chapter14:Mass-StorageSystemsDiskStructureDiskSchedulingDiskManagementSwap-SpaceManagementRAIDStructureDiskAttachmentStable-StorageImplementationTertiaryStorageDevicesOperatingSystemIssuesPerformanceIssuesDiskStructureDiskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer.

The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially.Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder.Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost.DiskSchedulingTheoperatingsystemisresponsibleforusinghardwareefficiently—forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth.

操作系統(tǒng)有責任高效地使用硬件——對于磁盤設(shè)備,這意味著很短的訪問時間和磁盤帶寬。Accesstimehastwomajorcomponents訪問時間包括兩個主要部分Seektimeisthetimeforthediskaretomovetheheadstothecylindercontainingthedesiredsector.尋道時間是指把磁頭移到所需柱面的時間。Rotationallatencyistheadditionaltimewaitingforthedisktorotatethedesiredsectortothediskhead.旋轉(zhuǎn)延遲是指等待磁盤上所需要的扇區(qū)旋轉(zhuǎn)到磁頭下面的時間。DiskSchedulingMinimizeseektime最小尋道時間Seektimeseekdistance尋道時間尋道距離Diskbandwidthisthetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer.

磁盤帶寬,是用傳輸?shù)目偽粩?shù),除以第一個服務(wù)請求與最后傳輸完成之間的總時間。DiskScheduling(Cont.)SeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests.Weillustratethemwitharequestqueue(0-199).

98,183,37,122,14,124,65,67 Headpointer53FCFSIllustrationshowstotalheadmovementof640cylinders.SSTFSelectstherequestwiththeminimumseektimefromthecurrentheadposition.SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests.Illustrationshowstotalheadmovementof236cylinders.SSTF(Cont.)SCANThediskarmstartsatoneendofthedisk,andmovestowardtheotherend,servicingrequestsuntilitgetstotheotherendofthedisk,wheretheheadmovementisreversedandservicingcontinues.Sometimescalledtheelevatoralgorithm(電梯算法).Illustrationshowstotalheadmovementof208cylinders.SCAN(Cont.)C-SCANProvidesamoreuniformwaittimethanSCAN.Theheadmovesfromoneendofthedisktotheother.servicingrequestsasitgoes.Whenitreachestheotherend,however,itimmediatelyreturnstothebeginningofthedisk,withoutservicinganyrequestsonthereturntrip.Treatsthecylindersasacircularlistthatwrapsaroundfromthelastcylindertothefirstone.C-SCAN(Cont.)C-LOOKVersionofC-SCANArmonlygoesasfarasthelastrequestineachdirection,thenreversesdirectionimmediately,withoutfirstgoingallthewaytotheendofthedisk.C-LOOK(Cont.)SelectingaDisk-SchedulingAlgorithmSSTFiscommonandhasanaturalappealSCANandC-SCANperformbetterforsystemsthatplaceaheavyloadonthedisk.Performancedependsonthenumberandtypesofrequests.Requestsfordiskservicecanbeinfluencedbythefile-allocationmethod.Thedisk-schedulingalgorithmshouldbewrittenasaseparatemoduleoftheoperatingsystem,allowingittobereplacedwithadifferentalgorithmifnecessary.EitherSSTForLOOKisareasonablechoiceforthedefaultalgorithm.DiskManagementLow-levelformatting,orphysicalformatting—Dividingadiskintosectorsthatthediskcontrollercanreadandwrite.Touseadisktoholdfiles,theoperatingsystemstillneedstorecorditsowndatastructuresonthedisk.Partitionthediskintooneormoregroupsofcylinders.Logicalformattingor“makingafilesystem””.Bootblockinitializessystem.ThebootstrapisstoredinROM.Bootstraploaderprogram.Methodssuchassectorsparingusedtohandlebadblocks.MS-DOSDiskLayoutSwap-SpaceManagementSwap-space—Virtualmemoryusesdiskspaceasanextensionofmainmemory.Swap-spacecanbecarvedoutofthenormalfilesystem,or,morecommonly,itcanbeinaseparatediskpartition.Swap-spacemanagement4.3BSDallocatesswapspacewhenprocessstarts;holdstextsegment(theprogram)anddatasegment.Kernelusesswapmapstotrackswap-spaceuse.Solaris2allocatesswapspaceonlywhenapageisforcedoutofphysicalmemory,notwhenthevirtualmemorypageisfirstcreated.4.3BSDText-SegmentSwapMap4.3BSDData-SegmentSwapMapRAIDStructureRAID–multiplediskdrivesprovidesreliabilityviaredundancy.RAIDisarrangedintosixdifferentlevels.RAID(cont)Severalimprovementsindisk-usetechniquesinvolvetheuseofmultipledisksworkingcooperatively.Diskstripingusesagroupofdisksasonestorageunit.RAIDschemesimproveperformanceandimprovethereliabilityofthesMirroringorshadowingkeepsduplicateofeachdisk.Blockinterleavedparityusesmuchlessredundancy.RAIDLevelsRAID(0+1)and(1+0)DiskAttachmentDisksmaybeattachedoneoftwoways:HostattachedviaanI/OportNetworkattachedviaanetworkconnectionNetwork-AttachedStorageStorage-AreaNetworkStable-StorageImplementationWrite-aheadlogschemerequiresstablestorage.Toimplementstablestorage:Replicateinformationonmorethanonenonvolatilestoragemediawithindependentfailuremodes.UpdateinformationinacontrolledmannertoensurethatwecanrecoverthestabledataaTertiaryStorageDevicesLowcostisthedefiningcharacteristicoftertiarystorage.Generally,tertiarystorageisbuiltusingremovablemediaCommonexamplesofremovablemediaarefloppydisksandCD-ROMs;othertypesareavailable.RemovableDisksFloppydisk——thinflexiblediskcoatedwithmagneticmaterial,enclosedinaprotectiveplasticcase.Mostfloppiesholdabout1MB;similartechnologyisusedforremovabledisksthatholdmorethan1GB.Removablemagneticdiskscanbenearlyasfastasharddisks,buttheyareatagreaterriskofdamagefromexposure.RemovableDisks(Cont.)Amagneto-opticdiskrecordsdataonarigidplattercoatedwithmagneticmaterial.Laserheatisusedtoamplifyalarge,weakmagneticfieldtorecordabit.Laserlightisalsousedtoreaddata(Kerreffect).Themagneto-opticheadfliesmuchfartherfromthedisksurfacethanamagneticdiskhead,andthemagneticmaterialiscoveredwithaprotectivelayerofplasticorglass;resistanttoheadcrashes.Opticaldisksdonotusemagnetism;theyemployspecialmaterialsthatarealteredbylaserlight.WORMDisksThedataonread-writediskscanbemodifiedoverandover.WORM(“WriteOnce,ReadManyTimes”)diskscanbewrittenonlyonce.Thinaluminumfilmsandwichedbetweentwoglassorplasticplatters.Towriteabit,thedriveusesalaserlighttoburnasmallholethroughthealuminum;informationcanbedestroyedbynotaltered.Verydurableandreliable.ReadOnlydisks,suchadCD-ROMandDVD,comfromthefactorywiththedatapre-recorded.TapesComparedtoadisk,atapeislessexpensiveandholdsmoredata,butrandomaccessismuchslower.Tapeisaneconomicalmediumforpurposesthatdonotrequirefastrandomaccess,e.g.,backupcopiesofdiskdata,holdinghugevolumesofdata.Largetapeinstallationstypicallyuserobotictapechangersthatmovetapesbetweentapedrivesandstorageslotsinatapelibrary.stacker–librarythatholdsafewtapessilo––librarythatholdsthousandsoftapesAdisk-residentfilecanbearchivedtotapeforlowcoststorage;thecomputercanstageitbackintodiskstorageforactiveuse.OperatingSystemIssuesMajorOSjobsaretomanagephysicaldevicesandtopresentavirtualmachineabstractiontoapplicationsForharddisks,theOSprovidestwoabstraction:Rawdevice––anarrayofdatablocks.Filesystem–theOSqueuesandschedulestheinterleavedrequestsfromseveralapplications.ApplicationInterfaceMostOSshandleremovabledisksalmostexactlylikefixeddisks——anewcartridgeisformattedandanemptyfilesystemisgeneratedonthedisk.Tapesarepresentedasarawstoragemedium,i.e.,andapplicationdoesnotnotopenafileonthetape,itopensthewholetapedriveasarawdevice.Usuallythetapedriveisreservedfortheexclusiveuseofthatapplication.SincetheOSdoesnotprovidefilesystemservices,theapplicationmustdecidehowtousethearrayofblocks.Sinceeveryapplicationmakesupitsownrulesforhowtoorganizeatape,atapefullofdatacangenerallyonlybeusedbytheprogramthatcreatedit.TapeDrivesThebasicoperationsforatapedrivedifferfromthoseofadiskdrive.locatepositionsthetapetoaspecificlogicalblock,notanentiretrack(correspondstoseek).ThereadpositionoperationretThespaceoperationenablesrelativemotion.Tapedrivesare“append-only”devices;updatingablockinthemiddleofthetapealsoeffectivelyeraseseverythingbeyondthatblock.AnEOTmarkisplacedafterablockthatiswritten.FileNamingTheissueofnamingfilesonremovablemediaisespeciallydifficultwhenwewanttowritedataonaremovablecartridgeononecomputer,andthenusethecartridgeinanothercomputer.ContemporaryOSsgenerallyleavethenamespaceproblemunsolvedforremovablemedia,anddependonapplicationsanduserstofigureouthowtoaccessandinterpretthedata.Somekindsofremovablemedia(e.g.,CDs)aresowellstandardizedthatallcomputersusethemthesameway.HierarchicalStorageManagement(HSM)Ahierarchicalstoragesystemextendsthestoragehierarchybeyondprimarymemoryandsecondarystoragetoincorporatetertiarystorage——usuallyimplementedasajukeboxoftapesorremovabledisks.Usuallyincorporatetertiarystoragebyextendingthefilesystem.Smallandfrequentlyusedfilesremainondisk.Large,old,inactivefilesarearchivedtothejukebox.HSMisusuallyfoundinsupercomputingcentersandotherlargeinstallationsthathaveenormousvolumesofdata.SpeedTwoaspectsofspeedintertiarystoragearebandwidthandlatency.Bandwidthismeasuredinbytespersecond.Sustainedbandwidth–averagedatarateduringalargetransfer;#ofbytes/transfertime.Dataratewhenthedatastreamisactuallyflowing.Effectivebandwidth–averageovertheentireI/Otime,includingseekorlocate,andcartridgeswitching.Drive’soveralldatarate.Speed(Cont.)Accesslatency––amountoftimeneededtolocatedata.Accesstimeforadisk–movethearmtotheselectedcylinderandwaitfortherotationallatency;<35milliseconds.Accessontaperequireswindingthetapereelsuntiltheselectedblockreachesthetapehead;tensorhundredsofseconds.Generallysaythatrandomaccess

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論