The operating system opened up as a set of mechanisms, each with a price. Six topics follow a program from the system call it makes, through the process that holds it, the scheduler that shares the cores and the page tables that keep it private, to the page cache and the file system that decide whether its data is fast, and whether it survives a crash.
6 topics
You already know what an operating system is. This chapter is about what it costs. Every read of a file, every new worker process, every thread beyond the number of cores and every random lookup into a large table passes through machinery in the kernel, and that machinery charges by the crossing, the switch, the page and the sync. None of it appears in the source code of the program paying for it.
The chapter starts at the boundary every program crosses to reach the outside world, the system call, and prices it. It builds the process on top of that boundary, as a private machine made of saved registers and page tables, and then shares a few real cores among hundreds of such machines. Three topics go into memory and storage: the address translation that makes the privacy possible, the faults and the cache that move pages between RAM and disk, and the file system as a data structure whose promises end at the sync.
Lantern appears once, in the page-cache topic, as a 1.8 GB index file living in the memory of an 8 GB server. No commands appear anywhere. Each topic names the mechanism, and where you would want to watch it on a real machine, it points to the chapter of Linux Deep Dive that shows how.