Paging, Page Faults and Replacement Policies · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.
En anglais

Faults, victims, and thrashing

Computing · Computer Systems · ages 20-21
Name ______________________   Date ____________
  1. In the taught model, two frames are full and an absent page is requested. How is room made?

    • Count a hit and keep the existing pages
    • Load it into either occupied frame without replacing anything
    • Evict a resident victim and reuse its frame
  2. Which access can cause a recoverable missing-page fault?

    • Access to a valid page absent from RAM
    • A permitted read from a resident page
    • A write to a resident page with read-only permission
  3. Which observation best fits thrashing?

    • A program waits for input with no paging
    • Frequent page transfers and little execution progress
    • Heavy file copying while program pages remain resident
  4. Start with two empty frames. For references 1, 2, 1, 3, 1, 2, how many FIFO faults occur, and which rule matters?

    • 4; a hit refreshes the page's arrival order
    • 3; initial loads into empty frames do not count
    • 5; hits leave arrival order unchanged
  5. Start with two empty frames. For references 1, 2, 1, 3, 1, 2, how many faults occur under LRU?

    Answer: ______________

  6. For a known finite trace, optimal replacement evicts a resident page used farthest in the future, including one never used again.

    Circle one:   True   False

  7. Logging only past references lets a kernel guarantee optimal replacement for every possible future.

    Circle one:   True   False

  8. Sam says LRU always has fewer faults than FIFO. With two empty frames and references 8, 9, 8, what disproves the claim?

    • LRU has 1 fault because the repeat removes an earlier fault
    • Both have 2 faults; a tie disproves 'always fewer'
    • FIFO has 0 faults because all distinct pages fit
LightMySky · lightmysky.comW1-mt_nEEuGL89Ze-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Faults, victims, and thrashing W1-mt_nEEuGL89Ze-s1

  1. Evict a resident victim and reuse its frame · Two frames cannot hold three distinct pages in this model. A victim leaves before its frame receives the requested page.
  2. Access to a valid page absent from RAM · The valid nonresident page needs missing-page recovery. A permitted resident read does not. The write to a read-only resident page violates permissions instead.
  3. Frequent page transfers and little execution progress · Thrashing combines repeated paging with poor execution progress. Storage activity from copying files is not enough to identify it.
  4. 5; hits leave arrival order unchanged · The hit on 1 leaves it oldest. Then 3 evicts 1, 1 evicts 2, and 2 evicts 3: five faults total.
  5. 4 · The references produce fault, fault, hit, fault, hit, fault: four faults.
  6. True · The offline rule protects pages needed sooner. A page never used again has no later reference to miss.
  7. False · Identical pasts can have different futures requiring different victims. Past logs alone do not supply future references.
  8. Both have 2 faults; a tie disproves 'always fewer' · Both load 8 and 9 with faults, then hit on 8. The equal totals contradict strictly fewer faults on every trace.
Worksheet · LightMySky