Demand Paging
A page fault incurs slowdown in the activity of the OS. We can find the new average memory access time that takes such a slowdown into account. To calculate it, we need to know (1) the normal average memory access time (which we calculated in Topic 7, Slide 36), (2) the time it takes to handle a page fault, and (3) the page fault rate on a scale from 0 to 1 (the fraction of memory accesses in which page faults happen).
Examples:
- If the normal average memory access time is 200 ns, the page fault handling time is 8000000 ns, and the page fault rate is 0.001, the updated average memory access time would be 0.001 * 8000000 + (1 - 0.001) * 200 = 8000 + 199.8 = 8199.8 ns (about 8.2 microseconds), which is about 40 times greater than 200 ns!
- If the normal average memory access time is 50 ns, the page fault handling time is 8000000 ns, and the page fault rate is 0.002, the updated average memory access time would be 0.002 * 8000000 + (1 - 0.002) * 50 = 16,000 + 49.9 = 16,049.9 ns (about 16 microseconds), which is about 320 times greater than 50 ns!