Handling Swap Page Faults

While swapping pages out of RAM memory is a relatively complicated undertaking, swapping them in is much simpler. As discussed in Chapter 4, the processor triggers a page fault when an attempt is made to access a page that is registered in the virtual address space of the process but is not mapped into RAM memory. This does not necessarily mean that a swapped-out page has been accessed. It is also possible, for example, that an application has tried to access an address that is not reserved for it, or that a nonlinear mapping is involved. The kernel must therefore first find out whether it is really necessary to swap in a page; it invokes the architecture-specific function handle_pte_fault, as discussed in Section 4.11 to do this by examining the memory management data structures.

Although the kernel reclaims all pages in the same way regardless of their backing store, this does not apply for the opposite direction. The method described here is only for anonymously mapped data that are read from one of the system's swap areas. When a page belonging to a file mapping is not present, the mechanisms discussed in Chapter 8 are responsible for providing the data.

Continue reading here: Swapping Pages in

Was this article helpful?

0 0