Unix Systems For Modern Architectures -1994- Pdf
This book is a classic, must-read for systems programmers, OS researchers, and anyone interested in low-level Unix kernel internals, especially regarding SMP (Symmetric Multi-Processing), scalability, and caching. Despite being from 1994, its concepts are still highly relevant.
Modern architectures had hundreds of cycles of cache-coherency traffic. A spinlock on a bus-based system was fine. On a NUMA (Non-Uniform Memory Access) machine? Suicide.
The PDF laid out the rule (still used today):
The heart of the book is the transition from the "Big Kernel Lock" to fine-grained locking. unix systems for modern architectures -1994- pdf
Schimmel breaks down the taxonomy of locking strategies available to OS architects in 1994:
The book guides the reader through the implementation of Spinlocks and Mutexes. It explains the nuances that are still debated today:
This section of the book is pure gold. It moves beyond theory into the gritty details of implementation, discussing how to modify the scheduler, how to handle signals in an SMP environment, and how to manage virtual memory when multiple threads are accessing page tables. This book is a classic, must-read for systems
The classic Unix scheduler (circa 1987) used a simple decayed CPU priority. In 1994, that was vandalism.
Why? A process migrated from CPU 0 to CPU 1 would find its L1 cache cold. It would run 3x slower for the first 10ms.
The PDF's solution: The "Affinity Scheduler." The book guides the reader through the implementation
"A process should return to the CPU it last ran on. If that CPU is busy, it is better to idle for 1ms than to migrate."
This was radical. Idling to preserve cache was counterintuitive, but on a 150MHz Alpha, it was mathematically correct.
