Explore efficient userspace optimistic spinning locks in this Linux Plumbers Conference talk. Dive into the limitations of traditional pthread library locking functions and discover a hybrid spinning/sleeping lock solution. Learn how this new approach combines the best attributes of sleeping and spinning locks, offering improved locking throughput and reduced lock cacheline contention. Understand the mechanics of userspace and kernel spinning, queue-based waiting, and adaptive sleep strategies. Gain insights into optimizing lock performance for large NUMA systems and applications with high concurrency demands. Cover topics such as lock starvation prevention, the "oil filter" concept, and improvements to optimistic spinning protocols (OSP).
Overview
Syllabus
Introduction
Locking in Userspace
AdvantagesDisadvantages
Limitations
Optimistic Spinning Filter
Optimistic Spinning in the Kernel
Problems with OSP
Improving OSP
Lock starvation
Oil filter
Mutex
OSP
Critical Section
Taught by
Linux Plumbers Conference