Page Faulting within System Calls
Most data accessed by system calls is pageable by default. This includes the system call code, static data, dynamically allocated data, and stack. As a result, a system call can be preempted in two ways:
Attention: A page fault that occurs while external interrupts
are disabled results in a system crash. Therefore, a system call should
be programmed to ensure that its code, data, and stack are pinned
before it disables external interrupts.
- By a more favored process, or by an equally favored process when a time slice has been exhausted
- By losing control of the processor when it page faults
In the latter case, even less-favored processes can run while the system call is waiting for the paging I/O to complete.