A system uses FIFO policy for page replacement. It has 4 pages frames with no…
2024
A system uses FIFO policy for page replacement. It has 4 pages frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur ?
- A.
196
- B.
192
- C.
197
- D.
195
Attempted by 52 students.
Show answer & explanation
Correct answer: A
The system uses FIFO page replacement with 4 frames. Initially, no pages are loaded.
First, 100 distinct pages are accessed. Since frames start empty and hold only 4 pages, the first 100 accesses all result in page faults. After these 100 pages, the frames contain the last 4 distinct pages accessed (P97, P98, P99, P100).
Next, the same 100 pages are accessed in reverse order. The first 4 accesses (P100, P99, P98, P97) match the pages currently in frames, resulting in 4 hits. The remaining 96 accesses (P96 down to P1) are not in frames and cause page faults.
Total page faults = 100 (forward pass) + 96 (reverse pass) = 196.