KRN-221 · Linux Kernel Core · Advanced
Allocators: Buddy, Slab, vmalloc — full syllabus
How the kernel allocates memory at every scale, and how allocator behaviour surfaces as fragmentation and latency.
Who this course is for
Kernel and driver developers who allocate memory inside the kernel and need to choose the right allocator, debug fragmentation, and read allocator state without guessing.
Prerequisites
- KRN-220 or solid virtual-memory background
- Solid C
- Ability to build and load test modules
Course outline
Day 1 — The buddy allocator
- Zones, watermarks and migration types
- Order-N allocation and why high orders fail
- Reading /proc/buddyinfo, /proc/zoneinfo and /proc/pagetypeinfo
- Fragmentation mechanics and what compaction can and cannot fix
- Observing allocation latency under fragmentation
Day 2 — SLUB
- Caches, slabs and per-CPU freelists
- kmalloc size classes and what a kmalloc really costs
- kmem_cache_create: when a private cache is worth it
- /proc/slabinfo and slabtop as diagnostic tools
- slub_debug: poisoning, red zones and tracking
Day 3 — Choosing correctly and debugging
- kmalloc vs vmalloc vs alloc_pages: the decision rules
- GFP flags, allocation contexts and atomic allocation
- vmalloc space and vmap areas
- Debugging allocator problems: leaks, corruption signatures, fragmentation reports
- Capstone workshop
Hands-on labs
- Lab: drive the buddy allocator into fragmentation and read the result in /proc/buddyinfo and /proc/pagetypeinfo
- Lab: inspect SLUB state with slabinfo and slabtop and correlate caches with module behaviour
- Lab: use slub_debug poisoning to catch a use-after-free in a test module
- Lab: allocate the wrong way on purpose — high-order kmalloc under pressure, vmalloc in atomic context — and observe the failure modes
- Lab: trigger compaction and measure allocation latency before and after
Capstone project
Diagnose and fix an allocator pathology in a prepared kernel scenario: determine whether the failure is fragmentation, cache growth or a leak, prove it with buddyinfo and slabinfo evidence, apply the correct fix — GFP choice, cache design or allocation order — and show the numbers recovering under the same load.
What you leave with
- The kmalloc/vmalloc/alloc_pages decision rules
- GFP flag discipline for every allocation context
- Fluent reading of buddyinfo, pagetypeinfo and slabinfo
- slub_debug and compaction debugging practice
Upcoming dates
| Dates | Where | Seats | Early bird | Regular | |
|---|---|---|---|---|---|
| 22 Nov – 24 Nov 20263 full days | RiyadhIn person · KAFD Conference Centre | 6 of 14 | SAR 8,100until 23 Oct | ||
| 29 Nov – 1 Dec 20263 full days | Kuwait CityIn person · Al Hamra Tower | 11 of 14 | KWD 670until 30 Oct | ||
| 29 Nov – 1 Dec 20263 full days | MuscatIn person · Knowledge Oasis Muscat | 6 of 14 | OMR 830until 30 Oct | ||
| 6 Dec – 13 Dec 20266 half-days | Gulf bandLive online · 09:00–13:00 GMT+3 | 14 of 20 | US$1,580until 6 Nov | ||
| 7 Dec – 9 Dec 20263 full days | OttawaIn person · Kanata North Tech Park | 11 of 14 | CAD 2,930until 7 Nov | ||
| 14 Dec – 16 Dec 20263 full days | TorontoIn person · MaRS Discovery District | 6 of 14 | CAD 2,930until 14 Nov | ||
| 14 Dec – 16 Dec 20263 full days | LondonIn person · Shoreditch Works | 11 of 14 | GBP 1,680until 14 Nov | ||
| 14 Dec – 21 Dec 20266 half-days | Europe bandLive online · 09:00–13:00 CET | 3 of 20 | US$1,580until 14 Nov | ||
| 14 Dec – 21 Dec 20266 half-days | Americas bandLive online · 13:00–17:00 ET | 8 of 20 | US$1,580until 14 Nov | ||
| 21 Dec – 23 Dec 20263 full days | BerlinIn person · Factory Görlitzer Park | 6 of 14 | EUR 1,990until 21 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.