Page Faults (7+8) Flashcards

1
Q

Page fault

A

when page for given process (to be mapped) to phys address but the given page is not currently loaded into a physical space.

Process page virtual address may be accessible to the process in the virtual address space but the memory page/mapping for this page has not yet been added to the process page tables

Thus page still needs to loaded from secondary storage

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

What detects page faults and what handles the exceptions

A

MMU - detects

OS-kernel level applications do error handling

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

What happens when the OS handles a page fault

A

OS tries to make page accessible by mapping to phys mem otherwise, if required page cannot be accessed - process is terminated and illegal mem error is thrown

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

what is a trap (OS context)

A

exception or fault where OS temporarily switches to kernel mode, performs fault handling action before returning control back to originating process

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

Examples of OS traps

A

break points, division by zero, invalid memory access

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

Steps that OS takes to handle a page fault

A
  1. When MMU references a page table - either page is already in phys mem (accessed via temp mem cache used by page table to access frequent pages) or not in mem e.g. MMU tried to do mapping but there is no accessible page - OS elicits a trap
  2. Trap
  3. if trap - missing page pulled from secondary storage and mapped
  4. loaded into main mem address
    Once loaded OS exits kernel control (released from trap) and process continues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Three different page faults - name them

A

compulsory
capacity
policy

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

compulsory faults

A

most common
required pages not paged into mem
To avoid this - pre-fetching

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

what is pre fetching

A

frequently used pages are loaded int cache memory

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

capacity faults

A

page is scheduled but main mem is full of other pages. Another page must be swapped out

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

policy faults

A

page prematurely swapped out because of replacement algorithm

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

Pages that are high priority should be swapped into main mem before low priority pages? T/F

A

True

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

What does the scheduling of page resources

A

page replacement policy

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

what are the 3 core implementations in the MMU that page fault handling makes use of

A

mapping, page tables. page replacement policy

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

What kind of mem mapping does MMU use?

A

Assume that the MMU uses fully associative memory mapping

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

Assume that the MMU uses fully associative memory mapping - what does this mean

A

any page in VMem can be translated to any frame is phys mem - excluding those dedicated to kernel operations

17
Q

How does the MMU locate the page and load it to main mem

A

Done by using Page Table Base Register
Tells MMU whether page is in main mem or not
1. MMU looked in Translation Lookaside Buffer (not in TLB - flagged as TLB miss)
2. MMU checks page table to see if already in main mem
Else: loaded from secondary storage

18
Q

what is the TLB

A

Translation Lookaside Buffer

special mem cache for storing frequently used pages