Two page faults on a memory-mapped file

A process mmap()s a large log file with MAP_PRIVATE shortly after a fresh boot, before anything has ever read that file (nothing from it is in the page cache). It reads one byte at an offset it has never touched. Later, it reads a byte at a different offset in the same file, one that another, unrelated process happened to read moments earlier, so that page is now already resident in the page cache. Contrast the page fault triggered by each of these two accesses.

34 of 53 in Operating Systems