CS FundamentalsModerateGATE CS

How many page faults occur when a process sequentially reads a 1 MB file through mmap() with 4 KB pages, assuming no read-ahead and none of the file is cached?

  1. A. 1
  2. B. 1024
  3. C. 128
  4. D. 256

Correct answer: D. 256

Each 4 KB page is faulted in on first touch: 1 MB / 4 KB = 256 faults. Read-ahead or huge pages would reduce the number of faults.

More Operating Systems questions

Exams that ask this topic