Paging

Whenever we perform a page lookup, we access memory, which could hinder the activity of the OS. In addition, page tables must be copied during context switches, making context switches slower.

How can paging be done faster? Possible solutions:

  1. Store the page table entries inside a set of registers on the CPU. This will limit the amount of entries that we can store at a time because the CPU has several available registers only.
  2. Store the page table in main memory, and use a single register (page-table base register (PTBR)) to indicate the location of the page table in memory. Context switching is fast, because only this single register needs to be changed. However, we will need to access memory twice for every access: to find the frame number and then to use the resulting physical address to access memory.