CSE Roadmap

Common tier · about 4 hours · 7 parts

Part 1 of 7 · 1 min read

Why this page comes sixth

In this module you will

  • Say what a huge page is, and why it helps the TLB, the page tables and the fault count.
  • Tell explicit huge pages (a reserved pool) from transparent huge pages (chosen by the kernel).
  • Read the settings and counters of transparent huge pages on a Linux system.
  • Measure the change in faults, time and resident size when a region uses huge pages.
  • Explain why huge pages can waste memory, and why they do not always make a program faster.

Level 6 made two promises about large pages. Page 3 said that 4 KiB has been the common page size for decades. Page 4 said that a 2 MiB page skips one level of the table walk. Page 5 gave the formula for the reach of the TLB, entries times page size. This page keeps those promises for Linux. The sources are OSTEP chapter 19 (for the TLB reasoning), OSC chapter 9 and the kernel documentation of transparent huge pages. The test programs were compiled with gcc -O2 -Wall -Wextra and run on a Linux machine with 4 KiB base pages and a 2 MiB huge page size.

About this example About this example

Real: The facts, definitions and algorithms on this page come from the books named in the text. No program on this page was timed.

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.