Structures of the Page Table

  1. Hashed Page Tables: Remember that we introduced the idea of a hash map in Chapter 2? A page table can have a hash map structure!
    • When we want to find the frame that corresponds to a page number, we take the following 3 steps:
      1. We plug the page number into the hash function and get an integer as a result,
      2. We then plug this integer into the page table (just as you would access an array,)
      3. We extract the frame number from that spot in the page table.
    • Because the hash function might return the same result for two different pages (this rare case is called 'a collision'), each spot in the hash map is not a single integer but a list of nodes. Each node in a list contains a page number, a frame number, and a link to the next node in that list. We simply check against the nodes in the list at that page table slot to see which one contains our page number, and then extract the frame number from that same node.
    • A hashed page table is very fast: it has O(1) [constant] access time! Yay!