The major components of page fault service are:
- Service the page fault interrupt:
- trap to OS
- save registers and state of faulting process
- determine that it was a page fault interrupt
- find location of requested page on disk
- select a page to be replaced
- deal with a dirty replaced page
- lock selected frame so that it won't be paged out
- issue I/O request to disk controller
- move faulting process to waiting queue
- select another process to be run from the ready queue
- restore state of selected process so that it can be run
- Swap or page in the page:
- disk controller queues request to read page
- wait in queue for device until scheduled
- wait for disk read
- transfer the page from disk to main memory using DMA
- generate I/O complete interrupt
- Restart the process:
- trap to OS
- save registers and state of interrupted process (this process
is not related to the faulted process)
- determine it was an I/O complete interrupt
- update page table and other tables
- move faulted process from wait to ready queue
- restore registers and state of interrupted program
- resume interrupted instruction
The first and third tasks take a few hundred instructions each
(perhaps 100 microseconds). Page switching takes perhaps 25 milliseconds.
Thus effective memory access time is dominated by the page fault rate.
Skill: Understand the mechanics of demand paging.
Revision Date: 2/15/98