The sequence of actions associated with a page fault are:
-
The page fault is detected by the MMU hardware.
-
The MMU hardware loads page fault handler PC/PSW from the interrupt vector (similar to interrupts)
-
After the page fault handler has fetched the page (possibly replacing some page) and recorded the changes in the page table, it must adjust the interrupted user's PC. It must be set back to the beginning of the instruction since the instruction did not execute.
-
Finally, the page fault handler can return control to the user, program, which will again attempt to execute the instruction that caused the page fault.
We would clearly like to minimize the number of page faults and avoid the extra time overhead necessary to handle page faults.