Open the task list on any lab computer and count the programs running: a browser, an editor, a music player, and a couple of dozen small helpers you never started. Each of them believes it owns all the memory in the machine. On a 64-bit computer each one usually thinks it has an address space of 128 terabytes, all to itself, while the machine holds perhaps 16 gigabytes of real RAM. Somebody keeps a map for every one of these private worlds, and somebody consults the right map on every single read and write. Kept carelessly, the maps would eat the RAM. Consulted carelessly, they would slow every instruction to a crawl.
This chapter is the operating system's side of those maps. The virtual memory chapter already built the basic tools: tables split into levels, the inverted table, and the TLB, a small notebook inside the processor that remembers recent answers. Here we recall each in a sentence and spend our time on what the OS itself has to decide: a hashed table that remembers only the pages that really exist, one table for every process and what a context switch does to the TLB, and the other way of cutting up a program, segmentation, which divides memory the way the programmer sees it and not the way the hardware finds convenient.
By the end you will be able to work out how many levels a page table needs and read what a process's tables cost on a real Linux machine, look up a page in a hashed table, say what the OS does to the TLB at a context switch and what that costs, translate a (segment, offset) pair and spot the trap, walk an address through segmented paging and the x86, and write the paging-versus-segmentation answer that examiners keep asking for. We go in six parts: big address spaces, tables that follow the pages that exist, the TLB at a context switch, segmentation, segmented paging, and the comparison with the sums put together.