VOOZH about

URL: https://www.phoronix.com/news/Linux-7.2-Slab

⇱ Linux 7.2 Slab Changes Include More Performance Optimizations - Phoronix


👁 Phoronix

Linux 7.2 Slab Changes Include More Performance Optimizations

Written by Michael Larabel in Linux Kernel on 17 June 2026 at 04:00 PM EDT. Add A Comment
The slab memory allocation changes for Linux 7.2 have been merged and continue to see more work around shaves and performance optimizations.

Among the interesting slab performance work for Linux 7.2 is this change to defer freelist construction until after bulk allocation from a new slab. Shengming Hu of ZTE noted in that change:
"In slub_bulk_bench, the time per object drops by about 42% to 70% with CONFIG_SLAB_FREELIST_RANDOM=n, and by about 58% to 69% with CONFIG_SLAB_FREELIST_RANDOM=y. This benchmark is intended to isolate the cost removed by this change: each iteration allocates exactly slab->objects from a fresh slab. That makes it a near best-case scenario for deferred freelist construction, because the old path still built a full freelist even when no objects remained, while the new path avoids that work. Realistic workloads may see smaller end-to-end gains depending on how often allocations reach this fresh-slab refill path."

Another interesting for the SLUB allocator is to detach and reattach partial slabs in batch. Hao Li noted a small performance benefit for mmap() from it:
"The will-it-scale mmap benchmark shows a 2% ~ 5% performance improvement after applying this patch."

The slab pull request for Linux 7.2 that has since been merged also adds support for allocation tokens as a compiler feature of LLVM Clang 22++ for smarter partitioning of kmalloc caches based on the allocated object type.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.