cse 4/521 introduction to operating systems• virtual mem: thrashing ... rate) + controller...
TRANSCRIPT
CSE 4/521Introduction to Operating
SystemsLecture19– MassStorageStructureI
(OverviewofMass-StorageStructure,DiskStructure,DiskScheduling)Summer2018
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
Objective:• Todescribethephysicalstructureofsecondarystoragedevicesanditseffectson
theusesofthedevices• Toexplaintheperformancecharacteristics ofmass-storagedevices• Toevaluatediskschedulingalgorithms
2
Recap
• VirtualMem:AllocationofFrames• FixedAllocation(Equal&ProportionalAllocation)• PriorityAllocation• Globalvs.LocalAllocation
• VirtualMem:Thrashing• CausesofThrashing• AddressingThrashingthroughWorking-SetModel• AddressingThrashingthroughPage-FaultFrequency
3
Questions1. Whatisthecauseofthrashing?Howdoesthesystem
detectthrashing?Oncedetected,whatcanthesystemdotoeliminatethrashing?(Easy)
2. Isitpossibleforaprocesstohavetwoworkingsets,onerepresentingdata andanotherrepresentingcode?(Medium)
3. Considerasystemthatallocatespagesofdifferentsizes toitsprocess.Whataretheadvantagesofsuchapagingscheme?(Open-ended)
4
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
5
Overview of Mass Storage Structure• Magneticdisksprovidebulkofsecondarystorageofmoderncomputers• Drivesrotateat60to250timespersecond• Transferrateisrateatwhichdataflowbetweendriveandcomputer
• Positioningtime(random-accesstime)istimetomovediskarmtodesiredcylinder (seektime)andtimefordesiredsector torotateunderthediskhead(rotationallatency)
• Headcrashresultsfromdiskheadmakingcontactwiththedisksurface-- Thatʼsbad
• DriveattachedtocomputerviaI/Obus• Bussesvary,includingEIDE, ATA,SATA,USB,Fibre Channel,SCSI,SAS,Firewire
6
Moving-head Disk Mechanism
7
Overview of Mass Storage Structure:Hard Disk
• Rangefrom30GBto3TBperdrive• Performance• TransferRate– theoretical– 6Gb/sec• EffectiveTransferRate– real–1Gb/sec• Seektimefrom3msto12ms–9mscommonfordesktopdrives• Averageseektimemeasuredorcalculatedbasedon1/3oftracks• Latency basedonspindlespeed• 1/(RPM/60)=60/RPM
• Averagelatency=½latency
8
(From Wikipedia)
• AccessLatency=Averageaccesstime=averageseektime+averagelatency• Forfastestdisk3ms+2ms=5ms• Forslowdisk9ms+5.56ms=14.56ms
• AverageI/Otime=averageaccesstime+(amounttotransfer/transferrate)+controlleroverhead
• Forexampletotransfera4KBblockona7200RPMdiskwitha5msaverageseektime,1Gb/sectransferratewitha.1mscontrolleroverhead=• 5ms+4.17ms+0.1ms+transfertime=• Transfertime=4KB/1Gb/s= 32Kb/(Gb/s)=0.031ms• AverageI/Otimefor4KBblock=9.27ms+.031ms=9.301ms
9
Overview of Mass Storage Structure:Hard Disk Performance
10
Overview of Mass Storage Structure:The First Commercial Disk Drive
1956IBM RAMDAC computer included the IBM Model 350 disk storage system
5M (7 bit) characters50 x 24” plattersAccess time = < 1 second
2018
• Nonvolatilememoryusedlikeaharddrive• Manytechnologyvariations
• CanbemorereliablethanHDDs• MoreexpensiveperMB• Maybehaveshorterlifespan• Lesscapacity• Butmuchfaster• Bussescanbetooslow->connectdirectlytoPCIforexample• Nomovingparts,sonoseektimeorrotationallatency
11
Overview of Mass Storage Structure:Solid-State Disks
• Wasearlysecondary-storagemedium• Evolvedfromopenspoolstocartridges
• Relativelypermanentandholdslargequantitiesofdata• Accesstimeslow
• Randomaccess~1000timesslowerthandisk• Mainlyusedforbackup,storageofinfrequently-useddata,transfermediumbetweensystems
• Keptinspoolandwoundorrewoundpastread-writehead• Oncedataunderhead,transferratescomparabletodisk
• 140MB/secandgreater• 200GBto1.5TBtypicalstorage
• CommontechnologiesareLTO-{3,4,5}andT10000
12
Overview of Mass Storage Structure:Magnetic Tape
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
13
• Diskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer• Low-levelformattingcreateslogicalblocksonphysicalmedia
• The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially• Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder
• Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost
• Logicaltophysicaladdressshouldbeeasy• Exceptforbadsectors• Non-constant#ofsectorspertrackviaconstantangularvelocity
14
Disk Structure
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
15
Disk Scheduling
• Theoperatingsystemisresponsibleforusinghardwareefficiently— forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth
• Minimizeseektime• Seektime» seekdistance
• Diskbandwidthisthetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer
16
Disk Scheduling
• TherearemanysourcesofdiskI/Orequest• OS• Systemprocesses• Usersprocesses
• OSmaintainsqueueofrequests,perdiskordevice• IdlediskcanimmediatelyworkonI/Orequest,busydiskmeansworkmustqueue• Optimizationalgorithmsonlymakesensewhenaqueueexists
17
Disk Scheduling• NotethatdrivecontrollershavesmallbuffersandcanmanageaqueueofI/Orequests(ofvarying“depth”)• SeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests• Theanalysisistrueforoneormanyplatters• Weillustrateschedulingalgorithmswitharequestqueue(0-199)
98,183,37,122,14,124,65,67Headpointer53
18
Disk Scheduling:FCFS
19
Illustration shows total head movement of 640 cylinders
Disk Scheduling:SSTF
• ShortestSeekTimeFirstselectstherequestwiththeminimumseektimefromthecurrentheadposition
• SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests
• Illustrationshowstotalheadmovementof236cylinders
20
Credits for slides
Silberschatz,GalvinandGagne
21