BPF Hybrid Lock: Using eBPF to communicate with the scheduler
Résumé
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.
Domaines
Système d'exploitation [cs.OS]Origine | Fichiers produits par l'(les) auteur(s) |
---|