How does kernel know, which pages in the virtual address space correspond to a swapped out physical page frame?
Linux: When swap file is used the Page Table Entry gets updated with one marked as invalid and holding information about where it is saved in the swap file. That is: an index to the swap_info array and an offset within the swap_map. Example from (an a bit old) Page Table Entry type (pte_t) on … Read more