How does kernel know, which pages in the virtual address space correspond to a swapped out physical page frame?
Consider the following situation: the kernel has exhausted the physical RAM and needs to swap out a page. It picks least recently used page frame and wants to swap its contents out to the disk and allocate that frame to another process. What bothers me is that this page frame was already mapped to, generally speaking, several (identical) pages of several processes. The kernel has to somehow find all of those processes and mark the page as swapped out. How does it carry that out? Thank you. EDIT: Illustrations to the question: Before the swapping processes 1 and 2 had a shared Page 1, which