Adaptive futexes: spin if the owner is still running on another CPU
summary
Proposal: store the lock owner (owner TID) in the futex word so the kernel can observe the owner’s run state and spin if owner is running on another CPU instead of immediately sleeping. Prototype uses the restartable sequences shared area as a small counter (restartable sequences shared counter) so the kernel grants an extended time slice ~50µs to avoid preemption, and can detect release and transfer the futex inside the kernel. Requires a libc/kernel contract and Futex 2 syscall support; prototype is under 100 lines and shows large benchmark wins.
AI-written summary · about
chapters (10)
- 0:00Introduction and motivation
- 1:48Real-time kernel lock contention
- 3:10Adaptive mutexes concept
- 5:21User space spin locks dilemma
- 8:09Lazy preemption in the kernel
- 10:15Extended time slice for user space
- 13:26Futex 2 and adaptive spinning
- 17:18Combining solutions for performance
- 21:51Implementation and future work
- 24:10Q&A







