KRN-232 · Linux Kernel Core · Expert
Memory Barriers & the Kernel Memory Model — full syllabus
The hardest correctness topic in the kernel: reordering, barriers, and reasoning about concurrent code that actually holds.
Who this course is for
Senior kernel, driver and runtime engineers writing or reviewing lockless code — the people whose bugs only reproduce on other people's hardware.
Prerequisites
- KRN-230 and KRN-231 or equivalent concurrency depth
- Solid C
- Ability to skim disassembly
Course outline
Day 1 — Reordering is real
- Compiler reordering vs CPU reordering, and why both matter
- Store buffers and invalidate queues: the hardware intuition
- smp_mb, smp_rmb, smp_wmb and what each forbids
- Acquire and release semantics as the modern default
- READ_ONCE and WRITE_ONCE: what they do and do not do
Day 2 — The Linux Kernel Memory Model
- What the LKMM formalises and why it exists
- Litmus tests: structure, naming and how to read an outcome
- Running litmus tests with herd7
- The classic patterns: message passing, load buffering, store buffering
- Mapping model outcomes back to real architectures
Day 3 — Dependencies and review
- Address, data and control dependencies
- The traps inside control dependencies specifically
- Reviewing lockless code without fooling yourself: a structured checklist
- When to give up and take the lock
- Capstone workshop
Hands-on labs
- Lab: run classic litmus patterns (MP, LB, SB) through herd7 and predict each outcome before the tool confirms it
- Lab: break a message-passing handoff by removing a barrier and observe the failure — or explain why your architecture hides it
- Lab: audit a real kernel lockless path against LKMM rules and document every ordering guarantee
- Lab: rewrite a racy lockless sequence with acquire/release and verify it with KCSAN
- Lab: construct a control-dependency bug and explain precisely why it miscompiles
Capstone project
Review a piece of lockless kernel code the way a maintainer would: an ordering argument for every shared access, herd7 litmus tests for the two riskiest patterns, KCSAN evidence, and a final verdict — merge, fix, or take the lock — with reasoning that survives hostile review.
What you leave with
- A working command of the Linux Kernel Memory Model
- Litmus testing with herd7
- Precise use of acquire/release and READ_ONCE/WRITE_ONCE
- A review checklist for lockless code you can apply on Monday
Upcoming dates
| Dates | Where | Seats | Early bird | Regular | |
|---|---|---|---|---|---|
| 8 Nov – 10 Nov 20263 full days | RiyadhIn person · KAFD Conference Centre | 8 of 14 | SAR 9,110until 9 Oct | ||
| 15 Nov – 17 Nov 20263 full days | Kuwait CityIn person · Al Hamra Tower | 3 of 14 | KWD 760until 16 Oct | ||
| 15 Nov – 17 Nov 20263 full days | MuscatIn person · Knowledge Oasis Muscat | 8 of 14 | OMR 940until 16 Oct | ||
| 22 Nov – 29 Nov 20266 half-days | Gulf bandLive online · 09:00–13:00 GMT+3 | 14 of 20 | US$1,760until 23 Oct | ||
| 23 Nov – 25 Nov 20263 full days | OttawaIn person · Kanata North Tech Park | 3 of 14 | CAD 3,300until 24 Oct | ||
| 23 Nov – 30 Nov 20266 half-days | Europe bandLive online · 09:00–13:00 CET | 3 of 20 | US$1,760until 24 Oct | ||
| 30 Nov – 2 Dec 20263 full days | TorontoIn person · MaRS Discovery District | 8 of 14 | CAD 3,300until 31 Oct | ||
| 30 Nov – 2 Dec 20263 full days | LondonIn person · Shoreditch Works | 3 of 14 | GBP 1,900until 31 Oct | ||
| 30 Nov – 7 Dec 20266 half-days | Americas bandLive online · 13:00–17:00 ET | 8 of 20 | US$1,760until 31 Oct | ||
| 7 Dec – 9 Dec 20263 full days | BerlinIn person · Factory Görlitzer Park | 8 of 14 | EUR 2,230until 7 Nov |
Book a seat, or bring this course to your team
Seats can be reserved online; private delivery runs on-site or live online, adapted to your stack.
Questions about fit or prerequisites? Email hello@kernelsystems.academy. To save this syllabus, print this page to PDF from your browser.