When a program tries to access a page not currently in physical memory, a page fault occurs. What is the very first action the operating system takes after detecting this page fault?
Think about what the OS must do to make the requested data available to the program.
When a page fault occurs, the OS must bring the missing page from disk into physical memory before the program can continue. It does not terminate the program immediately or ignore the fault. Also, it chooses which page to swap out carefully, not randomly.
In a computer system, which hardware or software component detects that a page fault has occurred?
Consider which part handles virtual to physical address translation.
The MMU translates virtual addresses to physical addresses. If the page is not in memory, the MMU triggers a page fault. The CPU ALU handles calculations, the disk controller manages disk operations, and the NIC handles network communication.
Consider the following sequence of steps in handling a page fault. Which step correctly follows the previous one?
- Page fault is detected by the MMU.
- Operating system saves the state of the interrupted process.
- ?
- Page is loaded into physical memory.
Think about what the OS must do if there is no free space in memory.
If no free frame is available, the OS must choose a page to remove (victim page) to free space before loading the requested page. Resuming the process without loading the page or clearing the page table entry would cause errors. Sending an interrupt to the network controller is unrelated.
Which statement correctly distinguishes a minor page fault from a major page fault?
Consider whether disk access is needed in each case.
A minor page fault happens when the page is already in physical memory but not yet mapped to the process's page table, so no disk access is needed. A major page fault requires loading the page from disk into memory. The other options are incorrect descriptions.
Excessive page faults can cause a system to slow down drastically, a condition known as thrashing. Why does this happen?
Think about the speed difference between memory and disk.
Page faults require loading data from disk, which is much slower than memory. If page faults happen too often, the CPU waits a lot for disk I/O, reducing overall performance. Disk space or network bandwidth are not the main causes, and multitasking is not disabled during page faults.