A system uses FIFO policy for system replacement. It has page frames with no pages loaded to begin with. The system first accesses distinct pages in some order and then accesses the same pages but now in the reverse order. How many page faults will occur?
View worked solution
Answer: A
We can analyze the page faults by dividing the process into two phases:
Phase 1: First 100 accesses
Let the 100 distinct pages be accessed in the order . Since all 100 pages are distinct and the 4 frames are initially empty, every access results in a page fault.
At the end of Phase 1, the 4 frames will contain the last 4 accessed pages: .
Phase 2: Reverse 100 accesses
The pages are now accessed in the reverse order: .
- The first 4 accesses () are already present in the frames. Thus, these 4 accesses result in hits (0 page faults).
- The remaining 96 accesses ( down to ) are not present in the frames. Since we are moving strictly downwards in index, each of these 96 accesses will result in a page fault.
Total Page Faults:
Free practice · Your answers on this page are not saved.
