cse 4/521 introduction to operating systems• virtual mem: thrashing ... rate) + controller...

21
CSE 4/521 Introduction to Operating Systems Lecture 19 – Mass Storage Structure I (Overview of Mass-Storage Structure, Disk Structure, Disk Scheduling) Summer 2018

Upload: others

Post on 11-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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

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

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

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

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

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

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

• 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

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

• 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

• 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

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

• 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

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

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

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

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

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

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

Credits for slides

Silberschatz,GalvinandGagne

21