VOOZH about

URL: https://www.phoronix.com/news/Linux-6.19-Fix-Slab-Regression

⇱ Linux Fixes A Performance Regression In The Slab Code - Phoronix


👁 Phoronix

Linux Fixes A Performance Regression In The Slab Code

Written by Michael Larabel in Linux Kernel on 10 December 2025 at 05:32 AM EST. Add A Comment
A performance fix has been submitted to the Linux kernel for dealing with a regression in the Slab memory allocation code.

The sole patch with today's slab pull request for Linux 6.19 and to be back-ported to Linux 6.18 LTS stable is fixing a performance regression for code involving heavy kmem_cache_destroy() usage.

The kmem_cache_destroy() calls kvfree_rcu_barrier() that ends up flushing RCU sheaves across all slab caches when a cache is destroyed. But that isn't mnecessary with only the RCU sheaves belonging to the cache being destroy should need to be flushed. This stable fix introduces kvfree_rcu_barrier_on_cache() to be more selective about the sheaves being flushed so only the relevant ones are removed.

This new code is now faster and addresses some known performance regressions in the kernel code:
The performance benefit is evaluated on a 12 core 24 threads AMD Ryzen 5900X machine (1 socket), by loading slub_kunit module.

Before:
Total calls: 19
Average latency (us): 18127
Total time (us): 344414

After:
Total calls: 19
Average latency (us): 10066
Total time (us): 191264

Two performance regression have been reported:
- stress module loader test's runtime increases by 50-60% (Daniel)
- internal graphics test's runtime on Tegra23 increases by 35% (Jon)

The performance regression was introduced back in Linux 6.18-rc1 with the introduction of sheaves and persisted through the Linux 6.18 stable release. In the days ahead this patch should be back-ported to a stable Linux 6.18 point release.

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.