CS4410/11: Opera.ng Systems Storage Rachit Agarwal Anne Bracy - - PowerPoint PPT Presentation

cs4410 11 opera ng systems
SMART_READER_LITE
LIVE PREVIEW

CS4410/11: Opera.ng Systems Storage Rachit Agarwal Anne Bracy - - PowerPoint PPT Presentation

CS4410/11: Opera.ng Systems Storage Rachit Agarwal Anne Bracy Operating Systems Where are we? 4410 4411 Homeworks 4 + 1 - Projects 2 + 1 3 + 1 Exams - - Operating Systems Where are we? Max Mean Median Std. Dev. HW1 20


slide-1
SLIDE 1

CS4410/11: Opera.ng Systems

Rachit Agarwal Anne Bracy

Storage

slide-2
SLIDE 2

Operating Systems — Where are we?

4410 4411 Homeworks 4 + 1

  • Projects

2 + 1 3 + 1 Exams

slide-3
SLIDE 3

Operating Systems — Where are we?

Max Mean Median

  • Std. Dev.

HW1 20 19.2 20 1.66 HW2 35 26.71 26 5.34 HW3 HW4 10-P1 80 73 80 14.46 10-P2 11-P1 100 83.2 84 8.38 11-P2 100 82.5 84 10.21 11-P3

slide-4
SLIDE 4

Operating Systems — Recap

  • Processes and Threads
  • Abstraction of a computer (CPU, storage, network, …)
  • Synchronization, Deadlock
  • Sharing resources “correctly”
  • CPU Scheduling
  • Sharing CPU resources “efficiently”
  • Networking
  • Sharing network resources “efficiently”
slide-5
SLIDE 5

Operating Systems — Storage (Next 7 lectures)

Disk Memory Caches Registers SSD Sharing Storage “efficiently” and … Faster (?) More expensive Lower capacity

slide-6
SLIDE 6

Operating Systems — Memory

Goal of Memory Management

  • Sharing of memory across processes
  • Why share memory?
  • Why processes? Why not threads?
  • Time-sharing
  • Load one program onto machine
  • Execute to completion
  • Problem: Long I/O leads to inefficiencies
  • Space-sharing
  • Simultaneously running multiple processes
slide-7
SLIDE 7

Mail

0x00000000 0xFFFFFFFF

Apache Movie Apache

Kernel

PCBs

Memory — Sharing

Challenges of space-sharing

  • Protection
  • Across processes
  • Naming and addressing
  • Identify physical addresses?
  • Efficiency
  • Utilization? Using faster memory?
slide-8
SLIDE 8

Memory — Sharing

Option 1: Load all

  • Load all processes into memory
  • Switch between them under OS control
  • Must relocate program when load it
  • Big Problem: Protection
  • A bug in one processes can kill others
  • Guess who used it?
  • MS-DOS, MS-Windows
slide-9
SLIDE 9

Memory — Sharing

Option 2: Copy on load

  • Copy entire process memory to disk during I/O
  • Copy back when it restarts
  • No need to relocate
  • Big Problem: Performance
  • Why?
  • Guess who used it?
  • Early versions of Unix
slide-10
SLIDE 10

Memory — Sharing

Option 3: Access Check

  • Give each program a piece of memory
  • Upon each memory reference
  • check that it stays within its address space
  • How to implement this?
  • Address translation
  • Base and bound registers
  • Cray-1
slide-11
SLIDE 11

Memory Sharing — Access Check

Address Translation (more later)

  • Program generates virtual addresses
  • “Virtual addresses” translated into physical addresses
slide-12
SLIDE 12

Memory Sharing — Access Check

Base and Bound registers

  • Base: Physical address corresponding to virtual address 0
  • Bound: higher allowable virtual address
slide-13
SLIDE 13

Memory Sharing — Model

Overall model

  • Each process has a virtual address space
  • Internally mapped to physical address space
  • Virtual to Physical allocation?
slide-14
SLIDE 14

Memory Sharing — Model

Virtual to Physical allocation

  • First-Fit
  • Allocate first “hole” that is big enough
  • Best-Fit
  • Allocate smallest “hole” that is big enough
  • Worst-Fit
  • Allocate largest “hole” that is big enough
slide-15
SLIDE 15

Memory Sharing — Model

Mail

0x00000000 0xFFFFFFFF

Apache Movie Apache

Kernel Virtual to Physical allocation: Problem?

  • External Fragmentation
  • Available physical memory, but fragmented
  • Various options
  • Wait for space (problem?)
  • Make space (how?)
slide-16
SLIDE 16

Memory Sharing — Model

Virtual to Physical allocation: Solution

  • Allocations at “finer granularity”
  • Pages
  • Break physical address space into fixed size pages
  • Map Virtual address space to multiple pages
  • Non-contiguous
  • Dynamic address translation