CSE Roadmap

Core tier · about 5 hours · 7 parts

Part 1 of 7 · 1 min read

Why this page comes seventh

In this module you will

  • Explain demand paging, and say why a program can run with most of its pages absent from memory.
  • Walk through the steps that the hardware and the kernel take on a page fault, in order.
  • Tell a minor page fault from a major page fault, and count both for a real program.
  • Compute the effective access time when a share of accesses cause page faults.
  • Name the places a missing page can come from: zero fill, a file and swap space.

Pages 3 to 6 built the translation machinery, and every page in them was assumed to sit in a frame. Real machines run programs larger than their memory, and most programs touch only part of what they own. This page removes the assumption: a page may be absent, and the hardware reports that through a fault. The next two pages then ask which page to throw out, and how many frames each process should get. The sources are OSTEP chapter 21, OSC chapter 10 and MOS chapter 3. The test programs were compiled with gcc -O2 -Wall -Wextra and run on a two-processor Linux machine with 4 KiB pages.

About this example About this example

Real: The C programs, commands and outputs on this page were compiled with gcc -Wall -Wextra -pthread and run on a Linux test machine (2 processors, kernel 6.18, glibc 2.39).

Scripted: Numbers marked "made up to show the idea" were chosen for the examples.

Not real: The page simplifies real systems. Actual kernels add more cases, limits and tuning than a short page can show.