4
1 CS414: Operating Systems Agenda Last time (This morning) I/O systems + Mass storage structure PA#4 back This time (Thurs night / Friday afternoon) Mass storage structure Security introduction Next time (Tuesday Nov 28) More security/protection PA#7 out (look for it early) Remember, no class next week Remember, PA#6 due NEXT Friday at noon! DO it soon!!! CS414: Operating Systems Schedule Sun Tues Thurs Fri No class – marty at conference File systems PA#5 due PA#6 out 7 9 14 16 21 23 protection,security 28 30 protection, security PA#7 out 5 Wrap-up PA#7 due Mass storage protection, security protection, security 10 No class – marty at conference No class – Thanksgiving No class – Thanksgiving 14 Final exam 0900-noon PA#6 due (noon) CS414: Operating Systems Before we start: PA#6 (Main) Datafile replaced today at noon or so! CS414: Operating Systems Optimizing Disk Accesses In timesharing systems, disk driver may have many different requests pending Approach: minimize disk seek time Some strategies are implemented in the disk driver, while others are implemented directly in the disk controller We'll look at FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK Example: range of request: 0-199; Head pointer currently at 53 The request sequence: 98, 183, 37, 122, 14, 124, 65, 67 CS414: Operating Systems Disk Scheduling: FCFS CS414: Operating Systems Disk Scheduling: SSTF Potential problem with SSTF?

Disc Scheduling

Embed Size (px)

Citation preview

Page 1: Disc Scheduling

1

CS414: Operating Systems

Agenda

•Last time (This morning)�I/O systems + Mass storage structure�PA#4 back

•This time (Thurs night / Friday afternoon)�Mass storage structure�Security introduction

•Next time (Tuesday Nov 28)�More security/protection�PA#7 out (look for it early)

•Remember, no class next week •Remember, PA#6 due NEXT Friday at noon! DO it soon!!!

CS414: Operating Systems

ScheduleSun Tues Thurs Fri

No class – martyat conference

File systemsPA#5 duePA#6 out 7 9

14 16

21 23

protection,security

28 30

protection, securityPA#7 out

5

Wrap-upPA#7 due

Mass storage

protection, security

protection,security 10

No class – martyat conference

No class –Thanksgiving

No class –Thanksgiving

14Final exam0900-noon

PA#6 due(noon)

CS414: Operating Systems

Before we start: PA#6 (Main)

•Datafile replaced today at noon or so!

CS414: Operating Systems

Optimizing Disk Accesses

•In timesharing systems, disk driver may have many different requests pending

•Approach: minimize disk seek time•Some strategies are implemented in the disk driver, while others are implemented directly in the disk control ler

•We'll look at �FCFS, SSTF, SCAN, C-SCAN, LOOK, and C-LOOK

•Example: range of request: 0-199; Head pointer curr ently at 53�The request sequence: 98, 183, 37, 122, 14, 124, 65, 67

CS414: Operating Systems

Disk Scheduling: FCFS

CS414: Operating Systems

Disk Scheduling: SSTF

•Potential problem with SSTF?

Page 2: Disc Scheduling

2

CS414: Operating Systems

Disk Scheduling: SCAN (Elevator Algorithm)

CS414: Operating Systems

Disk Scheduling: C-SCAN

CS414: Operating Systems

Disk Scheduling: LOOK

CS414: Operating Systems

Disk Scheduling: C-LOOK

CS414: Operating Systems

Selecting a Disk-Scheduling Algorithm

• SSTF is common and has a natural appeal• SCAN and C-SCAN

� perform better for systems that place a heavy load on the disk.

• Performance depends on the number and types of requests.

• Requests for disk service can be influenced by the file-allocation method.

• Either SSTF or LOOK is a reasonable choice for the default algorithm.

CS414: Operating Systems

DEMO

•http://www.sysinternals.com/utilities/diskmon.html

Page 3: Disc Scheduling

3

CS414: Operating Systems

RAID

CS414: Operating Systems

RAID (cont.)

•Level 0 (“striping”)�Good: large requests�Bad: small requests; MTTF (no redundancy)

•Level 1 (“mirroring”)�Good: fault tolerance�Bad: Double the cost of storage

•Level 2�Bad: must be rotationally synchronized; hamming code

•Level 3�Good: fastest for large-file transfer �Bad: what happens if parity disk fails?

•Level 4•Level 5

�Good: Higher I/O rate for writing data; no dedicated parity disk�Bad: Not as fast as RAID 3

•Most popular are 0,1,3,5

CS414: Operating Systems

Disk Management

• Low-level formatting, or physical formatting — Dividing a disk into sectors that the disk controller can read and write.

• To use a disk to hold files, the operating system s till needs to record its own data structures on the disk .

� Partition the disk into one or more groups of cylinders.� Logical formatting or “making a file system”.

• Boot block initializes system.� The bootstrap is stored in ROM.� Bootstrap loader program.

• Methods such as sector sparing used to handle bad blocks.

CS414: Operating Systems

Swap-Space Management

• Swap-space — Virtual memory uses disk space as an extension of main memory.

• Swap-space can be carved out of the normal file system,or, more commonly, it can be in a separate d isk partition.

• Swap-space management� 4.3BSD allocates swap space when process starts; holds text

segment (the program) and data segment.� Kernel uses swap maps to track swap-space use.� Solaris 2 allocates swap space only when a page is forced out of

physical memory, not when the virtual memory page is first created.

CS414: Operating Systems

Power Management

•ENIAC�18000 vacuum tubes; 140,000 watts

•Typical desktop PC�200 watt power supply (loses 15% to heat)�100 million PCs � 20,000 Megawatts (= 20 nuclear power plants)

•Two general approaches for reducing power consumpti on�OS turns off components not in use�App program uses less energy (at degraded user experience)M

CS414: Operating Systems

Power Consumption in Laptops

Page 4: Disc Scheduling

4

CS414: Operating Systems

Reducing Power Consumption

•Display�Dimming

•Hard Disk�Spinning down/up�Increase disk cache in RAM?�Have OS inform app (e.g., auto-save in emacs?)

•CPU�Voltage/frequency scaling �Intel “SpeedStep”: 750MHz � 600MHz; 1.6V � 1.35V (related: “Quickstart”)

•Memory�Turn off cache (lines)?; writing main memory to disk?

•Wireless

CS414: Operating Systems

Crypto 101: Basic terminology

• Authentication : Assurance of identity of person or originator of data� Password, biometrics, challenge/response (e.g., certificates)

• Authorization : Rights to perform some action• Integrity : Maintaining data consistency

� Checksums, MD5 (hash)

• Confidentiality : Protection from disclosure to unauthorized persons� Encryption: cleartext � ciphertext, ciphertext � cleartext

• Non-repudiation : Originator of communications can't deny it later

• Availability : Resources available for authorized parties

CS414: Operating Systems

More definitions

• Threat : external to entity under consideration/protection

• Vulnerability : internal to entity under consideration/protection

• Example: sender S wants to send a message to receiver R; what can an “man-in-the-middle” do?

1. Capture message and keep it2. Capture message, read it, and relay it on3. Capture message, modify it and send it on4. Capture message, keep it, send it on, and then send it on again

(replay) – e.g., financial transactionNote: These are threats – whether or not the original message is

vulnerable to these threats is orthogonal!