operating systems {week 16b }

Download Operating Systems {week  16b }

Post on 01-Jan-2016

20 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D. Operating Systems {week 16b }. Virtual filesystem. A virtual filesystem provides transparent access to different filesystem types on multiple device types and disk partitions. Virtual machines (i). - PowerPoint PPT Presentation

TRANSCRIPT

Chapter 1: Information Technology

Operating Systems{week 16b}Rensselaer Polytechnic InstituteCSC 432 Operating SystemsDavid Goldschmidt, Ph.D.Virtual filesystemA virtual filesystem provides transparent access to different filesystem types on multiple device types and disk partitions

Virtual machines (i)A virtual machine is a layered approach that logically combines the kernel operating system and hardwareCreates the illusionof multiple processes,each executing on itsown virtual processorwith its own virtualmemory

http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9002552Virtual machines (ii) Non-virtual machine

Virtual machineVirtual machines (iii)Java programs execute on a native Java Virtual Machine (JVM)

Virtual machines (iv)Virtual machines provide complete protection of system resourcesEach virtual machine is isolated fromall other virtual machineswhich prohibits direct sharingof system resourcesVirtual machines can be difficult to implementdue to the effort required to providean exact duplicate of each underlying machine

I/O systemThe Input/Output (I/O) System has two primary objectives:Handle application I/O requestsMap logical address to physical disk or device addressSend response back to the applicationOptimize I/O performanceDepends on request type and device type

Disk drives & the disk controllerDisks and other devices operate in parallel to the CPU (but are much slower)Typical diskdrive mechanism:Arm seeks to theappropriate track Disk rotates untilthe desired sectoris accessed

Disk access timeDisk access time is the sumof the seek time and therotational latency Cache surroundingsectors or entire trackto improve performancePrinciple of locality (again!)I/O system structure

I/O request

I/O performance optimization (i)Disk access times are orders of magnitude slower than CPU execution times

Improve I/O performance by:Reducing the number of I/O requestsImplementing bufferingImplementing cachingEfficiently scheduling I/O requestsdo this at theapplication layerI/O performance optimization (ii)Use buffering to makephysical I/O requestsas large as possibleThis reduces thenumber of I/O requestsSpace-time tradeoffMisleads programmers?Other disadvantages?

I/O performance optimization (iii)Use caching to keep retrieved datain fast memory for potentialfuture accessEliminates one or moreI/O requestsSpace-time tradeoffPrinciple of locality (yet again!)

Disk context switchA disk context switch occurs when switching from one I/O request to anotherDisk context switch time is substantially higherthan process context switchDisk context switch time is substantially lowerthan disk read/write operationThe time to complete the nth I/O operation depends on where the (n-1)th operation finishedDisk I/O schedulingGoal: optimize disk performance

Scheduling algorithm determines which pending disk I/O request to select next:First-Come-First-Served (FCFS)Shortest Seek Time First (SSTF)Elevator (SCAN) and Circular SCAN (C-SCAN)

maximize throughput,ensure fairness, etc.First-come-first-served (FCFS)Request reference string specifies requested tracks:

44, 20, 95, 4, 50, 52, 47, 61, 87, 25First-come-first-served (FCFS)Request reference string specifies requested tracks:

98, 183, 37, 122, 14, 124, 65, 67

Shortest seek time first (SSTF)Request reference string specifies requested tracks:

44, 20, 95, 4, 50, 52, 47, 61, 87, 25

Shortest seek time first (SSTF)Request reference string specifies requested tracks:

98, 183, 37, 122, 14, 124, 65, 67

Elevator (SCAN)Request reference string specifies requested tracks:

44, 20, 95, 4, 50, 52, 47, 61, 87, 25

repeated end-to-end scansElevator (SCAN)Request reference string specifies requested tracks:

98, 183, 37, 122, 14, 124, 65, 67

Circular SCAN and LOOKCircular SCAN (C-SCAN) scans in one directionWhen it reaches one end of the disk, it returnsto the beginning of the disk without servicingany requests on the return trip

LOOK (and C-LOOK) algorithmsDisk arm moves in one direction as long asthere are pending requests in that directionOtherwise, it reverses direction immediately