SA
메인 내용으로 이동

Page Faults

  • when page is not present
  • hardware records the address and raises a page fault
  • operating system will
    • pick an empty frame or a page to evict
    • write back if dirty
    • load the page and update the page table
    • restart the instruction
    • make sure page table and translation look-aside buffers are updated
  • when evicting...
    • write back any changes
    • invalidate (V=0V=0)
  • if TLB is modified, apply that to page table
    • invalidate the translation
  • Similarly, we have LRU, FIFO, Random approach like Cache Evictions
    • use pseudo-LRU algorithm
  • Reference: H & P, "Computer Organizations," 3rd, Ed.
Translation Look-aside BuffersVirtual MemoryCachePossible?
HitHitHitPossible. Best Case!
HitHitMissPossible. TLB Hits. VM Hit is implied. Cache Miss.
MissHitHitTLB Misses, then hits in page table, then cache hits.
MissHitMissTLB Misses, then hits in page table, then cache misses.
MissMissMissTLB Misses, then page fault, then cache misses.
HitMissMissImpossible. Cannot hit in TLB if page is not present.
HitMissHitImpossible. Cannot hit in TLB if page is not present.
MissMissHitImpossible. Data cannot be in cache if the page is not present.