Paging Flashcards

1
Q

What happens to the physical address space when paging is introduced?

A

Divided into fixed sized blocks called frames

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

What happens to the logical address space when paging is introduced?

A

Divided into fixed size blocks called pages.

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

How does paging work?

A

Logical pages are allocated into physical frames

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

How are the logical addresses structured?

A

Two part logical address, page number (p) and page offset (d)

p = m-n
d = n
Where m = logical address space.

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

What does the page number index?

A

Page table, the lookup table that maps page numbers to frame addresses in physical memory.

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

How are the pages mapped to frames?

A

Page number doesn’t have to be the same as the frame number in memory, the page table handles the translation.

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

What is the size of a page?

A

Defined by hardware, typically 4/8KB. However, many systems support multiple page sizes.

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

What is the relationship between processes and paging?

A

Page table per process, defines the logical address space of the process.

Required pages allocated from available frames

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

What fragmentation does paging cause?

A

External - none.

Internal - Depends on page size and process requirements.

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

What are the trade-offs of page size?

A

Smaller pages = less internal fragmentation

larger pages = smaller page table

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

How are page tables implemented?

A

Dedicated registers, fast but only feasible for small page tables.

Page table held in memory, dedicated register points to page table when executing - pointer stored in PCB on context switch

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

What is the translation look-aside buffer?

A

TLB, set of dedicated high-speed associative registers, each containing a key:value.

Lookup examines all keys simultaneously.

Fast, expensive

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

Why should address translation be cached?

A

Exploit temporal and spatial locality in programs

Avoid page table lookups

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

What is TLB used for?

A

Subset of page table entries stored in TLB, keys are page numbers and values are frame numbers. Looked in before page table.

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

What happens on hit and miss in a TLB?

A

TLB Hit: Frame found

TLB Miss: Lookup page table, storage entry in TLB and replace existing entry if needed.

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

What is the TLB hit ratio?

A

Percentage of times a page number is found in the TLB, determining effective memory access time (eat)

a = memory access time
b = TLB access time

eat = (hit ratio * (a + b)) + ((1 - hit ratio) * (2 * a + b))

17
Q

How is protection implemented using paging?

A

Protection bits associated with each frame. One bit can indicate R/W or R-Only. Violation causes trap to kernel.

18
Q

Why do we need multi-level paging?

A

Logical address space typically large and as such, simple page tables would be very large.

19
Q

How does hierarchical paging work?

A

Page the page table - non contiguous.

Outer page table indexes pages of the page table, entries contain frame numbers for page table pages. Table contents as before.

20
Q

What happens to the page table entries logical address when we expand the page table?

A

p1, p2 = m - n/2

p1, p2, d

21
Q

What are the limits of hierarchical paging?

A

In standard paging, each process has a page table, a lot of page tables.

Just about works for 48 bits (four levels)

22
Q

How do inverted page tables work?

A

Single central page table with entry for each frame. Size proportional to the size of physical memory.

23
Q

What does each entry in the inverted page table contain?

A
  • Virtual address of page stored in frame.
  • PID
  • Flags
24
Q

How do hashed inverted page tables work?

A

Hash function applied to page number, hit if pid matches current process.

25
How do hashed inverted page tables deal with collisions
Chaining scheme required Hash function chosen to minimise collisions Search chain for PID