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

Faults, victims, and thrashing

Computing · Computer Systems · ages 20-21
Name ______________________   Date ____________
  1. No frame is free when a fault arrives. What happens?

    • The machine melts
    • The fault is ignored
    • Another page is evicted as victim
  2. What triggers a page fault?

    • A page that is not resident is referenced
    • A program prints text
    • A disk spins quietly
  3. What does thrashing look like from outside?

    • A silent idle disk
    • Constant disk activity with tiny progress
    • Faster programs
  4. Same string under first in first out. How many faults, and why equal here?

    • 9, because FIFO double counts
    • 0, because frames are many
    • 4, because the repeat hits under both policies
  5. Three frames, refs 1, 2, 3, 1, 4. Count faults under least recently used.

    Answer: ______________

  6. The optimal policy evicts the page used farthest in the future.

    Circle one:   True   False

  7. A kernel could implement the optimal policy by logging past references.

    Circle one:   True   False

  8. Sam claims least recently used always faults less than first in first out. What is wrong?

    • Nothing, it always wins
    • The taught string ties at 4 faults each, so always is false
    • Policies never fault
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. Another page is evicted as victim · A victim must leave before the newcomer loads.
  2. A page that is not resident is referenced · Missing residency traps to the kernel for a fetch.
  3. Constant disk activity with tiny progress · Page moving replaces real work.
  4. 4, because the repeat hits under both policies · The early repeat hits either way, and only the tail evicts.
  5. 4 · Loads 1, 2, 3 fault, 1 hits, and 4 faults: 4 total.
  6. True · Farthest-next-use is the perfect victim choice.
  7. False · Past logs are not future knowledge, so it stays unimplementable.
  8. The taught string ties at 4 faults each, so always is false · One tie disproves always, as the example shows.
Worksheet · LightMySky