Paging Flashcards

1
Q

What’s another method that allows the physical address space of a process to be non-contiguous?

A

Paging

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

Paging divides physical memory into fixed-size blocks, called

A

page frams

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

Paging divides virtual memory into blocks of the same size called

A

pages

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

Paging uses a page table for

A

address translation

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

Does paging need both OS and hardware?

A

Yes

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

What sort of fragmentation does paging avoid, and what sort of fragmentation doesn’t it avoid?

A

Avoids external fragmentation
Doesn’t avoid internal fragmentation

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

The fact that paging doesn’t need to assume how the heap and stack grow and are used makes it more…

A

flexible

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

The fact that the page in the address space and the page frame are the same size in paging makes it easy to allocate and keep a free list, this makes paging more…

A

simple

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

To translate a page a virtual address is split into two parts, which are they?

A

Virtual Page Number (VPN) and offset

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

Give the definition:
Used as an index into a page table which contains base address of each page in physical memory.

A

Virtual Page Number (VPN)

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

Give the definition:
Combined with base address to define the physical memory address that is sent to the memory unit

A

Offset

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

To determine where a physical page is in paging we only need to translate the…

A

page number

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

What does the page table in paging do?

A

Keeps track of the mapping of virtual to physical addresses

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

What is the simplest form a page table?

A

A linear page table

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

What does a Page Table Entry (PTE) include?

A

Translation information, etc.

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

Give the definition:
A sort of page table that has an entry for each physical page frame of the system. The entry tells us which process is using this page, and which virtual page of the process maps to this physical page

A

Inverted page table

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

What are the pros of inverted page tables?

A

Memory saving

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

What are the cons of inverted page tables?

A

Long searching time, page sharing

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

How is page sharing implemented for a per-process page table?

A

By letting two pages point to the same frame

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

How is page sharing implemented for an inverted page table?

A

It’s difficult to implement

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

What is the biggest problem with paging?

A

The performance is affected by a factor of 2 due to every instruction requiring two memory accesses

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

Why do we use a Table Lookaside Buffer (TLB)?

A

To speed up the paging translation

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

Give the definition:
Virtual Page Number (VPN) is in TLB and can be quickly accessed

A

TLB hit

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

Give the definition:
VPN is not in TLB. Access page table to get the translation, update the TLB entry with the translation

A

TLB miss

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

What sort of locality makes it possible for the TLB to improve performance?

A

Spatial locality

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

Give the definition:
An instruction or data item that has been recently accessed will likely be re-accessed soon in the future

A

Temporal locality

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

Give the definition:
If a program accesses memory at address X, it will likely soon access memory near X

A

Spatial locality

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

TLB is a … associative cache

A

fully

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

Why is the TLB a fully associative cache?

A
  • Any given translation can be anywhere in the TLB
  • Hardware searches entire TLB in parallell to find the target
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What sort of entry is this?
VPN | PFN | Other bits

A

TLB entry

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

What is the biggest issue with the TLB?

A

Context switch

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

What are the two solutions to the issue with context switch with a TLB?

A

Flush and Address Space Identifier (ASID)

33
Q

Give the definition:
- OS flushes the whole TLB on context switch
- Flush operation sets all valid bits to 0

34
Q

What solution to context switching has this problem?
The overhead is too high if OS switches processes to frequently

35
Q

Give the definition:
- A field in the TLB, sort of like a process identifier

A

Adsress Space Identifier (ASID)

36
Q

What do we use instead of smaller pages to solve the problem of too big pages in paging?

A

Variable page size

37
Q

Give the definition:
One page table for each logical segment

A

Paging and segmentation

38
Q

What does the base register in paging and segmentation combined point to?

A

Physical address of the page table

39
Q

What does the limit register in the combination of segmentation and paging determine?

A

The size of the segment

40
Q

What are the two problems with combining segmentation and paging?

A
  • Page table waste for sparsely used heap
  • External fragmentation
41
Q

Give the definition:
Creating multiple levels of page tables with an outer level called a page directory which tracks whether a page of the page table is valid

A

Multi-level paging

42
Q

Multi-level paging only allocates page-table space in proportion to what?

A

The amount of address space being used

43
Q

What are these three points a motivation for?
- Processes spend the majority of time in a small portion of code
- Processes only use a small amount of address space at any moment
- Only a small amount of address space needs to be resident in physical memory

A

Page swapping

44
Q

Swapping makes it possible for the total physical address space of all processes to…

A

exceed the real physical memory of the system

45
Q

Give the definition:
Reserving of space on the disk for moving pages back and forth

A

Swap space

46
Q

How do we know where a pages lives?

A

Present bit / Valid bit

47
Q

What’s the objective of page swapping policies?

A

To minimize the number of page faults (cache misses)

48
Q

What are the two sorts of page selection?

A

Demand paging and prefetch

49
Q

Give the definition:
- Load page only when it’s needed
- Less I/O, less memory

A

Demand paging

50
Q

What’s the issue with demand paging?

A

High page fault cost

51
Q

Give the definition:
- Load page before referencing
- OS predicts future accessed pages and brings them into memory early
- Works well for some access patterns, like sequential pages

52
Q

Give the definition:
Copy the page only is a process writes to it (demand)

A

Copy-On-Write Paging

53
Q

What is the normal approach to page replacement?

A

Swap Daemon, Page Daemon

54
Q

Give the definition:
- There are fewer than LW (Low Watermark) pages available, a background thread that’s responsible for freeing memory is activated
- The thread evicts pages until there are High Watermark (HW) pages available

A

Swap Daemon, Page Daemon

55
Q

Average Memory Access Time (AMAT)

A

Phit * Tm * Pmiss * Td

56
Q

What are the four most commonly used page replacement policies?

A

Optimal replacement
FIFO
Least-Recently-Used (LRU)

57
Q

Give the definition:
Replace the page which isn’t used for the longest time in the future

A

Optimal replacement

58
Q

What page replacement policy has the following pros:
Minimal number of page faults

A

Optimal replacement

59
Q

What page replacement policy has the following cons:
Impractical, need to predict the future

A

Optimal replacement

60
Q

Give the definition:
Replace the page which is loaded into memory first

61
Q

What page replacement policy has the following pros:
Fair, easy to implement

62
Q

What page replacement policy has the following cons:
May evict useful pages

63
Q

Give the definition:
Replace the page which hasn’t been used for the longest time

A

Least-Recently-Used (LRU)

64
Q

What page replacement policy has the following pros:
Approximate optimal replacement

65
Q

What page replacement policy has the following con:
Difficult to implement

66
Q

The performance of replacement policies also depends on…

67
Q

When there’s a random workload, which replacement policy works best?

A

No difference

68
Q

When there’s a 80/20 workload, which replacement policy works best?

69
Q

When there’s a looping sequential workload, which replacement policy works best?

70
Q

What happens to the performance of LRU and RAND, if more physical memory is added?

A

Have fewer, or the same number, of page faults

71
Q

What happens to the performance of FIFO, if more physical memory is added?

A

More page faults due to Belady’s anomaly

72
Q

What does description implement?
- A datastructure to track reference time of all pages
- A timestamp register added to each page
- Approximating of implementation, by finding an old page, but not necessarily the oldest one

73
Q

What algorithm does this describe?
A use/reference bit for each page
A circular queue of all physical pages
A clock hand to select which page to evict

A

Clock algorithm (second chance)

74
Q

A form of flexible virtual memory management is…

75
Q

What VMM has these to challenges:
Slow access
Big page table and high memory consumption

76
Q

What is used to solve the problem with slow access in paging?

77
Q

What techniques within paging are used when we have a big page table?

A

Multi-level paging and inverted page tables

78
Q

What techniques are used when we have a larger address space in paging?

A

Swapping and replacement