212k views
4 votes
A demand paging system has allocated four frames to a process whose page access sequence is as given below.

Pageaccesssequence: 3 5 6 7 6 1 3 5 2 7 2 6 5 7 3 F.1

F.2

F.3

F.4

Page fault count:

How many page faults will have occurred with FIFO Page Replacement Policy until the end of the given page access sequence?
a. 6
b. 3
c. 7
d. 5

User SurferJoe
by
7.2k points

1 Answer

6 votes

Final answer:

According to FIFO Page Replacement Policy, the total number of page faults in the given page access sequence is 10. This happens as the system loads new pages and replaces the older ones in the order they were accessed.

Step-by-step explanation:

The question relates to the concept of demand paging in operating systems, specifically how many page faults will occur using the FIFO Page Replacement Policy with the given page access sequence. We can track the page frames and count the faults as new pages are loaded.

  • Initially, all frames are empty, so the first four pages (3, 5, 6, 7) will cause page faults.
  • When page 6 is accessed again, there is no page fault.
  • Accessing page 1 will cause a page fault, and as per FIFO policy, page 3 will be replaced (the oldest page).
  • Page 3 is then accessed, causing another page fault, replacing page 5.
  • This pattern continues with page 2 replacing page 6, page 7 causing no fault, page 2 replacing page 7, and page 6 replacing page 1.
  • Lastly, accessing pages 5, 7, and 3 will each cause a page fault, replacing pages 3, 2, and 6 respectively.

Thus, the total number of page faults is 10: 4 initial faults plus 6 more as the system replaces older pages with new ones according to the FIFO policy.

User PeeS
by
6.8k points