Improving CPU Isolation with per-cpu spinlocks: performance cost and analysis
summary
Work shows replacing queue_work_on(isolated_cpu) with per‑cpu spinlocks avoids IPIs and preserves CPU isolation while costing surprisingly little: a normal spinlock adds ~35 cycles on x86 but an inlined/raw variant cuts that to <15 cycles and a kmalloc-real-world test shows ~9 cycles extra (inlined ~4); remote operations are rare so contention is negligible; preempt_rt already converts local locks to spinlocks and a proposed local_q_work_on helper grabs the remote per‑cpu spinlock instead of scheduling work.
AI-written summary · about
chapters (14)
- 0:00Introduction to CPU isolation
- 1:05Per-CPU caches and global locks
- 3:57Problem with IPI in CPU isolation
- 4:39Per-CPU spinlocks as a solution
- 6:26Performance cost of spinlocks
- 8:14Real-world overhead measurements
- 9:18Conclusion and benefits
- 10:21Addressing PREEMPT_RT concerns
- 12:31Q&A on local locks vs spinlocks
- 13:16Overhead in non-RT scenarios
- 14:41Implementation details and benchmarks
- 15:42Q&A on cache data necessity
- 16:04Spinlock inlining and kernel size
- 17:29Workload and remote operations frequency
related talks
01h 38mLock-free Programming is Dead - Long Live Lock-free Programming!
48m“Is Parallel Programming still hard? PART 2 of 2”
01h 00mOut-of-order execution - what can it do for me?
44mRestartable Sequences: Scheduler-Aware Scaling of Memory Use on Many-Core Systems
01h 14m“C++ atomics, from basic to advanced. What do they really do?”
53mTurbo Charge CPU Utilization in Fork/Join Using the ManagedBlocker
29mConcurrency and Parallelism From The Ground Up
25mTackling Contention : The Monster in sync.Locker
