![Page 1: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/1.jpg)
CSE 4/521Introduction to Operating
SystemsLecture19– MassStorageStructureI
(OverviewofMass-StorageStructure,DiskStructure,DiskScheduling)Summer2018
![Page 2: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/2.jpg)
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
Objective:• Todescribethephysicalstructureofsecondarystoragedevicesanditseffectson
theusesofthedevices• Toexplaintheperformancecharacteristics ofmass-storagedevices• Toevaluatediskschedulingalgorithms
2
![Page 3: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/3.jpg)
Recap
• VirtualMem:AllocationofFrames• FixedAllocation(Equal&ProportionalAllocation)• PriorityAllocation• Globalvs.LocalAllocation
• VirtualMem:Thrashing• CausesofThrashing• AddressingThrashingthroughWorking-SetModel• AddressingThrashingthroughPage-FaultFrequency
3
![Page 4: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/4.jpg)
Questions1. Whatisthecauseofthrashing?Howdoesthesystem
detectthrashing?Oncedetected,whatcanthesystemdotoeliminatethrashing?(Easy)
2. Isitpossibleforaprocesstohavetwoworkingsets,onerepresentingdata andanotherrepresentingcode?(Medium)
3. Considerasystemthatallocatespagesofdifferentsizes toitsprocess.Whataretheadvantagesofsuchapagingscheme?(Open-ended)
4
![Page 5: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/5.jpg)
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
5
![Page 6: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/6.jpg)
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
![Page 7: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/7.jpg)
Moving-head Disk Mechanism
7
![Page 8: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/8.jpg)
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)
![Page 9: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/9.jpg)
• 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
![Page 10: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/10.jpg)
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
![Page 11: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/11.jpg)
• Nonvolatilememoryusedlikeaharddrive• Manytechnologyvariations
• CanbemorereliablethanHDDs• MoreexpensiveperMB• Maybehaveshorterlifespan• Lesscapacity• Butmuchfaster• Bussescanbetooslow->connectdirectlytoPCIforexample• Nomovingparts,sonoseektimeorrotationallatency
11
Overview of Mass Storage Structure:Solid-State Disks
![Page 12: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/12.jpg)
• 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
![Page 13: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/13.jpg)
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
13
![Page 14: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/14.jpg)
• Diskdrivesareaddressedaslarge1-dimensionalarraysoflogicalblocks,wherethelogicalblockisthesmallestunitoftransfer• Low-levelformattingcreateslogicalblocksonphysicalmedia
• The1-dimensionalarrayoflogicalblocksismappedintothesectorsofthedisksequentially• Sector0isthefirstsectorofthefirsttrackontheoutermostcylinder
• Mappingproceedsinorderthroughthattrack,thentherestofthetracksinthatcylinder,andthenthroughtherestofthecylindersfromoutermosttoinnermost
• Logicaltophysicaladdressshouldbeeasy• Exceptforbadsectors• Non-constant#ofsectorspertrackviaconstantangularvelocity
14
Disk Structure
![Page 15: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/15.jpg)
Overview
• OverviewofMass-StorageStructure• DiskStructure• DiskScheduling
15
![Page 16: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/16.jpg)
Disk Scheduling
• Theoperatingsystemisresponsibleforusinghardwareefficiently— forthediskdrives,thismeanshavingafastaccesstimeanddiskbandwidth
• Minimizeseektime• Seektime» seekdistance
• Diskbandwidthisthetotalnumberofbytestransferred,dividedbythetotaltimebetweenthefirstrequestforserviceandthecompletionofthelasttransfer
16
![Page 17: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/17.jpg)
Disk Scheduling
• TherearemanysourcesofdiskI/Orequest• OS• Systemprocesses• Usersprocesses
• OSmaintainsqueueofrequests,perdiskordevice• IdlediskcanimmediatelyworkonI/Orequest,busydiskmeansworkmustqueue• Optimizationalgorithmsonlymakesensewhenaqueueexists
17
![Page 18: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/18.jpg)
Disk Scheduling• NotethatdrivecontrollershavesmallbuffersandcanmanageaqueueofI/Orequests(ofvarying“depth”)• SeveralalgorithmsexisttoscheduletheservicingofdiskI/Orequests• Theanalysisistrueforoneormanyplatters• Weillustrateschedulingalgorithmswitharequestqueue(0-199)
98,183,37,122,14,124,65,67Headpointer53
18
![Page 19: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/19.jpg)
Disk Scheduling:FCFS
19
Illustration shows total head movement of 640 cylinders
![Page 20: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/20.jpg)
Disk Scheduling:SSTF
• ShortestSeekTimeFirstselectstherequestwiththeminimumseektimefromthecurrentheadposition
• SSTFschedulingisaformofSJFscheduling;maycausestarvationofsomerequests
• Illustrationshowstotalheadmovementof236cylinders
20
![Page 21: CSE 4/521 Introduction to Operating Systems• Virtual Mem: Thrashing ... rate) + controller overhead • For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average](https://reader033.vdocument.in/reader033/viewer/2022041915/5e696044eebaab0082438e3e/html5/thumbnails/21.jpg)
Credits for slides
Silberschatz,GalvinandGagne
21