Glossary
Slab allocator
An allocation strategy where memory is divided into per-type caches of fixed-size elements. XNU's zone allocator is a slab allocator.
A slab allocator is the family of allocators that divide memory into per-type caches of fixed-size elements. Each cache holds objects of one size; allocation is a fast free-list pop, free a fast free-list push. No fragmentation within a cache, excellent cache locality across allocations.
Origins trace to Jeff Bonwick's 1994 Solaris paper; the design has been adopted by Linux's SLAB/SLUB/SLOB, FreeBSD's UMA, and XNU's zone allocator.
XNU's specific implementation has per-CPU free-list caches in front of each zone — the hot path is essentially lock-free for high-frequency allocations. When a CPU's local cache empties, the slow path refills from the zone's global free-list under a per-zone lock.
The pattern is so dominant in modern kernels because it matches how kernel data structures are actually allocated: lots of struct foo, lots of struct bar, hardly any variable-size buffers. A heap-style allocator would waste cycles on size-class routing for every call; a slab allocator's caller already knows the size class because they know the type.
See also: zone allocator, kalloc, and the kernel allocators article.