Reliable Userspace Spinlock
Talkat Open Source Summit Europe 2023 · on Tuesday, 2023-09-19· at 16:35· Room 0B (Floor 0), Abandoibarra Etorb., 4, 48011 Bilbao, Bizkaia, Spain·
summary
Proposes using an extended rseq structure to record a thread’s rseq sched state so userspace can tell if a lock holder is actually running, spin only when the owner is running, and fall back to a futex slow path when the owner is not. Provides an RFC and a prototype implemented as an rsac mutex self-test that visibly spins and sleeps; requires glibc/rseq support, cache-structure tuning and broader benchmarks on x86/ARM before merging. Claims aim: avoid costly context switches for very short critical sections.
AI-written summary · about
chapters (12)
- 0:00Spinlocks and user-space challenges
- 3:37Mutexes with short critical sections
- 5:25Basic user-space spinlock
- 8:16Key challenges of spinlocks
- 9:21Restartable sequences foundation
- 14:45Extending sequences for spinlocks
- 17:57Userspace spinlock mechanism
- 19:26Testing and benchmarking
- 20:18Q&A: CPU retrieval and RCU
- 24:08Q&A: Virtualization and contention
- 26:11Q&A: Spinlock use cases
- 28:05Summary and closing
related talks
25mAdaptive futexes: spin if the owner is still running on another CPU
44mShip your Critical Section, Not Your Data: Enabling Transparent Delegation with...
44mRestartable Sequences: Scheduler-Aware Scaling of Memory Use on Many-Core Systems
40mKernel Locking Engineering
53mPREEMPT_RT - How Not to Break It.
32mRISC-V ftrace: working with preemption
19mExternal locking for internally synchronized data structures
24mReliability, Availability, and Serviceability (RAS) on ARM64 status
