Transcript
Page 1: Operating Systems {week  16b }

Operating Systems{week 16b}

Rensselaer Polytechnic InstituteCSC 432 – Operating SystemsDavid Goldschmidt, Ph.D.

Page 2: Operating Systems {week  16b }

Virtual filesystem

A virtual filesystem provides transparent access to different filesystem types on multiple device types and disk partitions

Page 3: Operating Systems {week  16b }

Virtual machines (i)

A virtual machine is a layered approach that logically combines the kernel operating system and hardware Creates the illusion

of multiple processes,each executing on itsown virtual processorwith its own virtualmemory

http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9002552

Page 4: Operating Systems {week  16b }

Virtual machines (ii)

Non-virtual machine Virtual machine

Page 5: Operating Systems {week  16b }

Virtual machines (iii)

Java programs execute on a native Java Virtual Machine (JVM)

Page 6: Operating Systems {week  16b }

Virtual machines (iv)

Virtual machines provide complete protection of system resources Each virtual machine is isolated from

all other virtual machines▪ which prohibits direct sharing

of system resources Virtual machines can be difficult to

implementdue to the effort required to providean exact duplicate of each underlying machine

Page 7: Operating Systems {week  16b }

I/O system

The Input/Output (I/O) System has two primary objectives: Handle application I/O requests▪ Map logical address to physical disk or device

address▪ Send response back to the application

Optimize I/O performance▪ Depends on request type and device type

Page 8: Operating Systems {week  16b }

Disk drives & the disk controller

Disks and other devices operate in parallel to the CPU (but are much slower) Typical disk

drive mechanism: Arm seeks to the

appropriate track Disk rotates until

the desired sectoris accessed

Page 9: Operating Systems {week  16b }

Disk access time

Disk access time is the sumof the seek time and therotational latency Cache surrounding

sectors or entire trackto improve performance

Principle of locality (again!)

Page 10: Operating Systems {week  16b }

I/O system structure

Page 11: Operating Systems {week  16b }

I/O request

Page 12: Operating Systems {week  16b }

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 requests Implementing buffering Implementing caching Efficiently scheduling I/O requests

do this at theapplication layer

Page 13: Operating Systems {week  16b }

I/O performance optimization (ii)

Use buffering to makephysical I/O requestsas large as possible This reduces the

number of I/O requests Space-time tradeoff Misleads programmers? Other disadvantages?

Page 14: Operating Systems {week  16b }

I/O performance optimization (iii)

Use caching to keep retrieved datain fast memory for potentialfuture access Eliminates one or more

I/O requests Space-time tradeoff Principle of locality

(yet again!)

Page 15: Operating Systems {week  16b }

Disk context switch

A disk context switch occurs when switching from one I/O request to another Disk context switch time is substantially

higherthan process context switch

Disk context switch time is substantially lowerthan disk read/write operation

The time to complete the nth I/O operation depends on where the (n-1)th operation finished

Page 16: Operating Systems {week  16b }

Disk I/O scheduling

Goal: 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.

Page 17: Operating Systems {week  16b }

First-come-first-served (FCFS)

Request reference string specifies requested tracks:44, 20, 95, 4, 50, 52, 47, 61, 87, 25

Page 18: Operating Systems {week  16b }

First-come-first-served (FCFS)

Request reference string specifies requested tracks:98, 183, 37, 122, 14, 124, 65, 67

Page 19: Operating Systems {week  16b }

Shortest seek time first (SSTF)

Request reference string specifies requested tracks:44, 20, 95, 4, 50, 52, 47, 61, 87, 25

Page 20: Operating Systems {week  16b }

Shortest seek time first (SSTF)

Request reference string specifies requested tracks:98, 183, 37, 122, 14, 124, 65, 67

Page 21: Operating Systems {week  16b }

Elevator (SCAN)

Request reference string specifies requested tracks:44, 20, 95, 4, 50, 52, 47, 61, 87, 25

repeated end-to-end scans

Page 22: Operating Systems {week  16b }

Elevator (SCAN)

Request reference string specifies requested tracks:98, 183, 37, 122, 14, 124, 65, 67

Page 23: Operating Systems {week  16b }

Circular SCAN and LOOK

Circular SCAN (C-SCAN) scans in one direction When it reaches one end of the disk, it returns

to the beginning of the disk without servicingany requests on the return trip

LOOK (and C-LOOK) algorithms Disk arm moves in one direction as long as

there are pending requests in that direction Otherwise, it reverses direction immediately


Top Related