Re: [Regression] mm:slab/sheaves: severe performance regression in cross-CPU slab allocation

From: Ming Lei

Date: Wed Feb 25 2026 - 04:42:57 EST


Hi Vlastimil,

On Wed, Feb 25, 2026 at 09:45:03AM +0100, Vlastimil Babka (SUSE) wrote:
> On 2/24/26 21:27, Vlastimil Babka wrote:
> >
> > It made sense to me not to refill sheaves when we can't reclaim, but I
> > didn't anticipate this interaction with mempools. We could change them
> > but there might be others using a similar pattern. Maybe it would be for
> > the best to just drop that heuristic from __pcs_replace_empty_main()
> > (but carefully as some deadlock avoidance depends on it, we might need
> > to e.g. replace it with gfpflags_allow_spinning()). I'll send a patch
> > tomorrow to test this theory, unless someone beats me to it (feel free to).
> Could you try this then, please? Thanks!

Thanks for working on this issue!

Unfortunately the patch doesn't make a difference on IOPS in the perf test,
follows the collected perf profile on linus tree(basically 7.0-rc1 with your patch):

```
04cb971e2d28 (HEAD -> master) mm:slab/sheaves: severe performance regression in cross-CPU slab allocation
a5a9cf3f020f mm: fix NULL NODE_DATA dereference for memoryless nodes on boot
7dff99b35460 (origin/master) Remove WARN_ALL_UNSEEDED_RANDOM kernel config option
551d44200152 default_gfp(): avoid using the "newfangled" __VA_OPT__ trick
6de23f81a5e0 (tag: v7.0-rc1) Linux 7.0-rc1
```

+ 49.03% 2.00% io_uring [kernel.kallsyms] [k] __blkdev_direct_IO_async
- 38.66% 1.16% io_uring [kernel.kallsyms] [k] bio_alloc_bioset
- 37.51% bio_alloc_bioset
- 34.98% mempool_alloc_noprof
- 34.87% kmem_cache_alloc_noprof
- 33.82% ___slab_alloc
- 30.25% get_from_any_partial
- 29.59% get_from_partial_node
- 28.42% __raw_spin_lock_irqsave
native_queued_spin_lock_slowpath
+ 2.16% allocate_slab
+ 0.60% alloc_from_new_slab
0.51% __pcs_replace_empty_main
1.58% bio_associate_blkg
+ 1.16% submitter_uring_fn
+ 35.16% 0.30% io_uring [kernel.kallsyms] [k] kmem_cache_alloc_noprof
+ 35.13% 0.12% io_uring [kernel.kallsyms] [k] mempool_alloc_noprof


Thanks,
Ming