Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Demand paging

Page-fault handling, animated.

Module 4 Session 4.5 Lesson 1 of 1

Demand Paging and Page Faults

Do not load a page until it is touched. A fault is the mechanism, not necessarily an error.

The valid bit

If the page is in RAM, the PTE is valid and holds a frame. If it is on backing store, valid=0. The first reference traps: save the process, find a frame, schedule disk I/O, restart the instruction.

Effective access time ≈ (1−p)·tmem + p·tfault. If tfault is 8 ms and tmem is 100 ns, even p = 0.001 dominates. Locality is why this works.

EAT calculator

  1. Trap to kernel; save user registers.
  2. Check PTE: illegal → kill; valid=0 but on swap → continue.
  3. Allocate a frame (maybe replace, next session).
  4. Read the page from disk; I/O wait.
  5. Set valid bit; restart the instruction.