Sample Header Ad - 728x90

Does mmap() update the page table after every page fault?

6 votes
1 answer
1427 views
Based on my research on mmap(), I understand that mmap uses demand paging to copy in data to the kernel page cache only when the virtual memory address is touched, through page fault. If we are reading files that are bigger than the page cache, then some stale page in the page cache will have to be swapped out reclaimed. So my question is, will the page table be updated to map the corresponding virtual memory address to the address of the old stale page in the cache (now containing new data)? How does this happen? Is this part of the mmap() system call?
Asked by prajasek (63 rep)
Apr 3, 2024, 01:38 AM
Last activity: Apr 5, 2024, 10:50 AM