what is a page fault

what is a page fault

1 year ago 38
Nature

A page fault is an exception raised by the memory management unit (MMU) when a process attempts to access a memory page that is not currently loaded in physical memory. When a page fault occurs, the operating systems kernel is notified and takes necessary actions to load the required page into physical memory. The page fault can be categorized as a minor or soft page fault if the page is loaded in memory at the time the fault is generated but is not marked in the MMU as being loaded in memory. In this case, the page fault handler in the operating system merely needs to make the entry for that page in the MMU point to the page in memory and indicate that the page is loaded in memory. If the page is not loaded in memory at the time of the fault, then it is called a major or hard page fault. The page fault handler in the OS needs to find a free location, either a free page in memory or a non-free page in memory.

Page faults are common and can be helpful to improve performance by raising the quantum of memory available for programs. However, invalid page faults can occur when a process attempts to retrieve an invalid memory address. The operating system detects this error and prevents the execution of the program by terminating it or by sending it into an infinite loop. In most cases, an invalid page fault occurs when the kernel detects that the page table entry corresponding to the requested virtual address does not exist in physical memory.

Read Entire Article