tags:

views:

25

answers:

1

What is the maximum number of page faults that can occur when trying to access a single page in a two-level page table?

My guess is two. One if the second level table is not in memory and one if the page in the second level page table is not in memory.

A: 

The maximum number is 3, because page tables themselves are are stored in virtual memory. So you have

  • one fault for the page directory (level 1 page table)
  • one fault for the page table referenced from the directory page (level 2 page table)
  • one fault for desired page

The minimum number is 0 if we have a TLB hit and the page itself is in memory.

See also here.

the_void