In closing, we mention the fact that there are at least three different mutually exclusive kernel-level implementations of the slab allocator; only one of them can be in use at runtime. The one to be used at runtime is selected at the time of configuring the kernel (you learned this procedure in detail in Chapter 2, Building the 5.x Linux Kernel from Source – Part 1). The relevant kernel configuration options are as follows:
- CONFIG_SLAB
- CONFIG_SLUB
- CONFIG_SLOB
The first (SLAB) is the early, well-supported (but quite under-optimized) one; the second one (SLUB, the unqueued allocator) is a major improvement on the first, in terms of memory efficiency, performance, and better diagnostics, and is the one selected by default. The SLOB allocator is a drastic simplification and, as per the kernel config help, "does not perform well on large systems."