John Rodewald
Personal notes I've decided to make public for some reason.


Multi-level Page Tables

Posted on

A Page-Table is a concept that can be represented by many different data structures. The simplest representation is a linear page table: an array of physical page numbers (plus other metadata) indexed by virtual page numbers. This data structure is not space-efficient as we have to store this exhaustive mapping for each process. With a 4KB page size and hundreds of processes, we would need hundreds of megabytes of memory.

A multi-level page table is a tree-like data structure:

Two main benefits arise from using this data structure:

We pay a price in increased implementation complexity and in having to make multiple memory accesses as we work our way down the tree. More generally, we trade off some speed to save a lot of space.

Tags: programming ostep