Week 5 Flashcards

1
Q

Page Fault Handling

A

Hardware Trap and Register Save:
The MMU traps the CPU to the OS, storing essential data and program counter on the stack.

Interrupt Service Routine (ISR):
ISR, written in assembly, saves registers and calls the page fault handler.

Virtual Page Identification:
OS identifies the required page, accessing data from hardware registers or parsing instructions.

Validation and Protection Check:
The OS verifies the address; invalid addresses terminate the process.

Page Frame Management:
The OS uses free frames or replacement algorithms for page loading; if dirty, the page is saved to disk.

Disk/SSD Operation:
The page is loaded into memory and flagged to prevent reuse.

Process Suspension and Resumption:
The OS suspends the faulting process and schedules another if possible.

Page Arrival and Update:
Page tables are updated when the page arrives.

Instruction Backup and Program Counter Reset:
The OS resets the program counter to re-execute the faulting instruction.

Process Scheduling and ISR Conclusion:
The faulting process is rescheduled, and the ISR restores the original context.

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

Local vs. Global Allocation Policies

A

Local Allocation: Allocates frames per process based on its page fault history (e.g., local LRU).

Global Allocation: Manages frames for all processes, with a single page replacement queue (e.g., global LRU).

Considerations:
Frame allocation per process.
Monitoring working set size to avoid thrashing.

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

Page Fault Frequency (PFF) Algorithm

A

PFF Monitoring: Tracks page faults per process.
Thresholds:
If page faults exceed threshold A, allocate more memory.
If faults are below threshold B, reduce memory.
If all processes reach threshold A, thrashing occurs, and load control may be required.

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

Load Control

A

Out of Memory (OOM) Killer: Terminates or swaps out processes if memory is overloaded.

Compaction and Deduplication: Clear space by combining fragmented memory or using same-page merging for identical pages across processes.

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

Cleaning Policy

A

Paging Daemon: Clears dirty frames to disk in the background, ensuring clean frames are available.

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

Page Sizes

A

Page Size Selection:
OS determines page size, commonly 4KB or larger.
Fragmentation occurs when small segments occupy a full page, wasting space.
Page Table Size increases with smaller pages, impacting TLB and memory.

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

Shared Pages and Libraries

A

Shared Pages: Allow multiple processes to use the same code page, reducing memory usage.

Shared Libraries: Libraries loaded once by one process become accessible to others, saving memory and resources.

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

Implementation Issues

A

Process Lifecycle:
Memory allocation during creation, page table updates during execution, and release of resources on termination.

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

Segmentation

A

Segmentation: Divides memory into variable-length segments.
Useful for managing memory based on logical divisions (e.g., code, data).
However, growing segments can lead to fragmentation and underutilized space.

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