Kernel Locking Engineering
summary
Presents a practical hierarchy of kernel locking patterns: prefer immutable state, single-owner handoff, reference counting and simple per-object locks before fine-grained or lockless tricks. Recommends tools and idioms: lockdep annotations and runtime lock-order checks, workqueues/flush_work, kref_get_unless_zero for composable weak refs, avoid inventing primitives, and treat RCU pitfalls carefully. Shows the DRM atomic mode-setting framework implemented as a check/commit transaction with per-object locks, mutex-graph ordering and ownership-based commits; the framework is used in drivers and proves the approach works in production.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:06Locking priorities
- 5:50Designing for correctness
- 10:32Avoiding custom primitives
- 13:06Performance considerations
- 15:00Protecting data over code
- 19:23Locking design patterns
- 23:35Simple lock approach
- 25:45Fine-grained locking
- 31:21Dangerous lockless tricks
- 36:19Case study: Atomic modesetting
related talks
26mConcurrency: Unlocking a Solution
01h 06mLocks are tricky — let's understand them by building one
01h 30mLive Lock-Free or Deadlock (Practical Lock-free Programming)
01h 09mNew locks for the old kernel
13mLockify: Understanding Linux Distributed Lock Management Overheads in Shared Storage
39mLive Lock-Free or Deadlock (Practical Lock-free Programming)
35mRecursive Read Deadlocks and Where to Find Them
01h 38mLock-free Programming is Dead - Long Live Lock-free Programming!
