BPF Hybrid Lock: Using eBPF to communicate with the scheduler - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Reports (Contract/Project Report) Year : 2023

BPF Hybrid Lock: Using eBPF to communicate with the scheduler


Multi-core processors have long been available, yet harnessing their full computing potential remains a challenge due to synchronization issues that impact performance. This work addresses the dilemma of choosing between spin locks, known for their responsiveness but prone to collapse in over-subscribed systems, and blocking locks, which are stable but less reactive. We introduce the BPF Hybrid Lock, a novel synchronization technique that dynamically transitions between spin locks and blocking locks based on system subscription. eBPF is used to detect lock holder preemptions. Our contributions include algorithms for seamless lock transitions, enhanced condition variable reactivity, and detection of the optimal time to switch from a spin lock to a blocking lock. We provide an implementation of the BPF Hybrid Lock using MCS and Linux Futex locks, showcasing performance improvements in under-subscribed systems, such as LevelDB, where write operation times decreased from 282 to 102µs and read times from 40 to 25µs.
Fichier principal
Vignette du fichier
BPF_Hybrid_Locks_Internship_report.pdf (4.78 Mo) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-04266815 , version 1 (31-10-2023)



  • HAL Id : hal-04266815 , version 1


Victor Laforet, Jean-Pierre Lozi, Julia Lawall. BPF Hybrid Lock: Using eBPF to communicate with the scheduler. Inria; Institut Polytechnique de Paris. 2023. ⟨hal-04266815⟩
45 View
58 Download


Gmail Mastodon Facebook X LinkedIn More