Virtual Memory Management Flashcards

1
Q

What is virtual memory used for?

A

Processes addresses a virtual address space. Virtual memory is larger than physical memory.

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

What is swapping?

A

Swap complete processes in and out of physical memory. Save/load from disk on very context switch, and restore paging tables.

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

What is demand paging?

A

Contents of virtual address space held on disk. Pages are copied to physical memory as needed by the Pager.

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

What are the benefits of demand paging?

A

Programmer isn’t concerned with amount of physical memory, making programming simpler and portable.

More ps can be run concurrently.

Less IO needed for loading and swapping processes

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

What are the drawbacks of demand paging?

A

Implementation is complex.

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

How is demand paging implemented?

A

HW support need, valid and invalid bit for each page table entry.

Valid bit indicates page is in memory

Invalid bit indicates page isn’t in memory.

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

What is a page fault?

A

Check the V/I bit on each memory reference, page as normal when valid and trap on invalid.

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

What happens when a page fault occurs?

A

Check address is legal, find a free frame then schedule disk read operation. Set the frame number and valid bit in the page table and restart the instruction that caused the fault

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

What is pure demand paging?

A

Need have no pages in memory to start execution of a process. PC initially points to invalid address. Page containing first instruction is faulted on PC dereference.

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

Why do we need to be able to restart an instruction?

A

Any instruction that accesses memory can cause a page fault, must be able to restart. Can be expensive for complex instructions.

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

How do we calculate demand paging performance?

A

EAT = (1-p) * ma * page fault time

where p = probability of page fault and ma is memory access time (10-200 ns)

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

What is over-allocation?

A

Process may use less physical memory than size of VM.

Physical memory can be over-allocated.

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

What are the benefits of over-allocation?

A

allows increased multi-programming and increases CPU utilisation and throughput.

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

What are the drawbacks of over-allocation?

A

When 1 > processes have increased VM demands memory is also used to buffer IO.

May find no free frames when servicing page fault.

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

How is over-allocation handles?

A

Terminate the process

Swap out a process completely (freeing its frames)

Page replacement

  • local (affects current process)
  • global (affect any process)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does Basic page replacement work?

A

Pick a page that isn’t being heavily used.
Free the frame (write page back to disk) and update page table.

Fault page into freed frame.

17
Q

What are the overheads of replacement?

A

2 page transfers are necessary, page fault service time is doubled.

18
Q

How can we reduce overheads of replacement?

A

Unmodified pages don’t have to be written to disk on replacement. Indice this with modify (dirty) bit.