Processing Page Faults
When a process attempts to access a page, for which the present bit in the
PTE is not set, a page fault occurs. The page fault is passed to OS/2 Version
2.0's page fault handler, and the following sequence of events takes place:
A PF is allocated from the free list or the LRU
end of the idle list. Should the PF be taken from the idle list, and its
current contents be marked as "dirty ", it will be necessary to first
write the page to the swap file.
Once the PF is available, its contents will be
loaded based on information contained in the VP. The source could be one
of the following:
- If the page is marked "allocate on demand ",
the physical memory manager will provide the page. If requested the page
is initialized to zeros.
- If the page is discardable, it is reloaded from an
executable file on disk.
- If the page is swappable but is currently on the idle
list, it can be reclaimed because it is still present in memory.
- If the page is swapped out, it is reloaded from the
swap file.
3.
The
PTE is updated with the PF address and the present bit is set on.
4.
5.
The
program instruction that caused the exception is restarted.
Figure "Page Swapping"
[Back: Managing Paging]
[Next: 16-Bit Applications in a 32-Bit Environment]