I use file mapping to read a 20 GB file. And when the main memory is exhausted, how is the kernel swapping the file mapped pages to the disk?
A possible way I guess is to set the page entry to NULL. Then next time if the page is accessed, the do_no_page()
function will be called again to map the file to memory. Is it right?
Another question is what's the priority the kernel uses to swap the memory pages? Normal page or file mapped page?