Midterm 1 Flashcards

(45 cards)

1
Q

1 GB =

A

2^30

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

1 MB =

A

2^20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

1 KB =

A

2^10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

giga-

A

10^9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Static rewriting

A

rewrites two processes’ addresses to be distinct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Static rewriting issues

A
  1. relocation at runtime is hard (have to constantly rewrite process memory and pointers are hard to keep track of and manage)
  2. security (no isolation, pointers can access any random location)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Dynamic relocation

A
  1. base:
    virtual address + base = physical address

can just change the base to automatically shift processes to new locations

  1. bound:
    mem access checked by bound (if out of bound –> interrupt)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

can processes access base and bound registers?

A

NO!!!!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

base and bounds implementation

A

new CPU unit called memory management unit (MMU)

MMU has two registers: base and bounds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

dynamic relocation issues

A

programs aren’t contiguous (chunks of free space between allocated memory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Segmentation

A

using multiple base and bounds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is a segment?

A

a base and bound pair that can be efficiently resized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

segmentation implementation

A

uses MMU with a segment table containing variable # of segments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

segmentation issues

A

requires contiguous regions but also results in external fragmentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

external fragmentation

A

combined space is large enough but memory is fragmented –> not individual free mem segment is useful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

internal fragmentation

A

the memory reserved for a process can’t be used by OS until the process terminates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

external fragmentation solution! (the bad one)

A

defragmentation: move previously allocated regions to get contiguous free space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

defragmentation issues

A

expensive! running process might be stopped and allocation takes too long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

external fragmentation solution! (the good one)

20
Q

Paging idea

A

fine-grained and regular (constant) division of memory (called pages)

21
Q

frames

A

fixed sized blocks of physical memory

22
Q

pages

A

fixed sized blocks of a process’ address space

23
Q

frame size = ?

24
Q

pros of paging

A
  1. don’t need a large contiguous region
    (process still sees the address space as contiguous)
  2. any page can be mapped to any frame
25
Page table
structure that maps a page to a frame using the virtual address - uses the MMU - only OS can change the page table
26
each process has its own page table
true
27
one-to-one paging
page table is just a linear array where each page has its own page table entry the page table entry contains the final frame number
28
address space (AS) limit/size
how much memory MAX the OS will allocate to one process
29
equation relating AS limit, page size, # pages
AS limit/page size = # pages
30
how to find a where page tables are stored in DRAM?
page table base register (ptbr) - accessed only in S-mode - shows physical address if linear PT: - can find any PTE from ptbr if multi-page: - ptbr points to highest level PT
31
one-to-one (linear) paging issues?
a PT can require A LOT of contiguous space = # PTEs * size of a PTE
32
multi-level page tables
solve the space issue of linear PTs: - multiple small PT instead of one big PT - only allocate each table when needed - remaining space in the address
33
size of a PTE =
architectural size (64-bit systems have 64-bit PTEs)
34
layout of a PTE (linear)
upper bits: physical frame # lower bits: page permissions
35
where are page tables stored: CPU cache or DRAM?
DRAM: cache is faster but much more expensive (not much memory space)
36
multi-level paging issues?
memory access is expensive: if you have N-levels of page tables, you need N + 1 DRAM accesses = N page tables + final frame access
37
multi-paging issues solutions!
1. TLB - translation lookaside buffer 2. cache
38
TLB
stores final translation (not the data itself) - OS needs to clear old TLB entries if any changes to PT are made
39
TLB issues
sometimes we need to: 1. check TLB to see if translation is cached 2. if not, store translation after walking the page table ** CPUs have optimization algorithms so TLB hits rates are very high and these issues are not significant
40
cache for paging why?
DRAM is slow, regardless of TLB hit or not
41
cache stores ___ while TLB stores ___
data, translation
42
memory access steps
1. check cache 2. cache miss --> check TLB 2a. TLB hit --> physical frame --> done 2b. TLB miss --> walk the PTs to find physical address 3. insert translation into TLB 4. insert data into cache
43
library sharing
44
lazy on-demand memory allocation
45