Introduced to the mainline Linux kernel last year was “sheaves” as an opt-in per-CPU array-based caching layer. Sheaves was merged back in Linux 6.18 and while it started as an opt-in caching layer, the plan is to replace more CPU slabs / caches with sheaves. Queued up for slated introduction in the upcoming Linux 7.0 cycle is replacing more of those caches with sheaves.
Queued up this week into slab.git’s slab/for-next Git branch are the patches to replace CPU partial slabs with sheaves.
SUSE engineer and SLAB maintainer Vlastimil Babka summed up the work in the recent patch series as:
“Percpu sheaves caching was introduced as opt-in but the goal was to eventually move all caches to them. This is the next step, enabling sheaves for all caches (except the two bootstrap ones) and then removing the per cpu (partial) slabs and lots of associated code.
Besides (hopefully) improved performance, this removes the rather complicated code related to the lockless fastpaths (using this_cpu_try_cmpxchg128/64) and its complications with PREEMPT_RT or kmalloc_nolock().
The lockless slab freelist+counters update operation using try_cmpxchg128/64 remains and is crucial for freeing remote NUMA objects without repeating the “alien” array flushing of SLUB, and to allow flushing objects from sheaves to slabs mostly without the node list_lock.
Sending this v4 because various changes accumulated in the branch due to review and -next exposure (see the list below). Thanks for all the reviews!”
Per-CPU partial caches had been used to accelerate objects allocation and freeing but now eliminated by sheaves.
There is “hopefully” improved performance but no numbers to quantify the possible performance impact from this expanded sheaves use.
With these patches now in slab/for-next after being staged at first in slab/for-7.0/sheaves, the work should be submitted in February as part of the Linux 6.20~7.0 cycle. Barring any last minute issues we’ll find this expanded sheaves use in the next mainline kernel version.
