Chapter 9 Flashcards

(40 cards)

1
Q

What is demand paging?

A

A technique where pages are loaded into memory only when they are first accessed.

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

What triggers a page fault?

A

Accessing a page that is not currently in physical memory.

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

First step in handling a page fault?

A

Validate the memory address to ensure the reference is legal.

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

Second step in handling a page fault?

A

If the reference is invalid, terminate the process; otherwise, page must be brought into memory.

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

Third step in handling a page fault?

A

Find a free frame in physical memory.

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

Fourth step in handling a page fault?

A

Read the required page from disk into the free frame.

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

Fifth step in handling a page fault?

A

Update the page table to mark the page as valid and in memory.

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

Final step in handling a page fault?

A

Restart the instruction that caused the page fault.

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

What is pure demand paging?

A

A system where no pages are loaded until they are accessed.

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

Why can one instruction cause multiple page faults?

A

Because the instruction, operands, or data may span multiple pages.

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

What is Effective Access Time (EAT)?

A

The average time to access memory considering page faults.

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

Formula for EAT?

A

EAT = (1 - p)memory_access + p(page fault overhead).

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

What is page fault rate p?

A

The probability (0 to 1) that a memory access will cause a page fault.

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

Why does a small p increase EAT significantly?

A

Page faults are extremely slow compared to normal memory accesses.

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

What is Copy-On-Write (COW)?

A

A technique where pages are shared until a write occurs, then a private copy is made.

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

When is Copy-On-Write used?

A

During fork() so parent and child share pages until modified.

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

What is page replacement?

A

Selecting a page to evict when no free frames exist and a new page must be loaded.

18
Q

Why is page replacement necessary?

A

Because memory is limited and all frames may be full when a new page is needed.

19
Q

What is a dirty/modify bit?

A

A bit that indicates whether a page has been modified since it was loaded.

20
Q

Why use a dirty bit?

A

To avoid writing unchanged (clean) pages back to disk, saving time.

21
Q

What is a reference string?

A

A sequence of page numbers representing the order of memory accesses.

22
Q

What is a page access string?

A

Another name for the reference string used in replacement algorithms.

23
Q

How do we evaluate a replacement algorithm?

A

Count how many page faults occur for a given reference string.

24
Q

What is Belady’s Anomaly?

A

When increasing the number of frames causes more page faults under FIFO.

25
Which algorithm can experience Belady’s Anomaly?
FIFO (First-In First-Out).
26
Which algorithms do NOT experience Belady’s Anomaly?
Optimal and LRU.
27
What is the Optimal replacement algorithm?
Replace the page that will not be used for the longest time in the future.
28
What is LRU replacement?
Replace the page that has not been used for the longest time in the past.
29
Why is Optimal not used in practice?
Because it requires knowing future page references.
30
What is frame allocation?
Determining how many frames each process receives.
31
What is minimum frame allocation?
Each process receives the fewest frames needed to execute safely.
32
What is maximum frame allocation?
A process receives all available frames except those reserved for the OS.
33
What is equal allocation?
Each process gets the same number of frames.
34
What is proportional allocation?
Each process gets frames based on its size.
35
What is thrashing?
When a process spends more time paging than executing.
36
Cause of thrashing?
Not allocating enough frames, leading to constant page faults.
37
Effect of thrashing on CPU usage?
CPU utilization falls, causing the scheduler to load more processes, making thrashing worse.
38
How does thrashing relate to minimum frames?
If a process has fewer than its required minimum frames, thrashing occurs.
39
What stops thrashing?
Reducing the degree of multiprogramming or giving processes more frames.
40
How does TLB relate to paging performance?
TLB hits reduce access time; misses require page table access and slow memory lookup.