Linux Symposium

Non-scalable locks are dangerous

Nickolai Zeldovich

Many Linux subsystems rely on non-scalable spinlocks (ticket locks) for serialization. Using Linux on a 48-core machine, we show that non-scalable locks can cause dramatic collapse in the performance of real workloads, even for very short critical sections. The nature and sudden onset of collapse are explained with a new Markov-based performance model. Replacing the offending non-scalable spin locks with scalable spin locks avoids the collapse and requires modest changes to source code.

Although scalable locks avoid collapse, they still limit scaling on systems with increasing numbers of cores. The second part of this talk will present our recent work on using RCU in the Linux virtual memory subsystem to avoid locks (namely mmap_sem) and achieve near-linear scalability on an 80-core machine, building on an RCU-based binary balanced tree.

Policies   |   Media Archives