Subject: Re: [PATCH v6 02/10] slab: add opt-in caching layer of percpu sheaves

From: Vlastimil Babka <[email-masked]>
Date: Thu, 28 Aug 2025 11:03:20 +0200

On 8/28/25 10:53, Thorsten Leemhuis wrote:
> On 28.08.25 10:01, Vlastimil Babka wrote:
>> On 8/28/25 09:43, Thorsten Leemhuis wrote:
>>> On 27.08.25 10:26, Vlastimil Babka wrote:
>>>> Specifying a non-zero value for a new struct kmem_cache_args field
>>>> sheaf_capacity will setup a caching layer of percpu arrays called
>>>> sheaves of given capacity for the created cache.
>>>>
>>>> Allocations from the cache will allocate via the percpu sheaves (main or
>>>> spare) as long as they have no NUMA node preference. Frees will also
>>>> put the object back into one of the sheaves.
>>>> [...]
>>>
>>> This patch showed up in linux-next today and from a *quick* glance at
>>> things I suspect it might be the reason why my daily next rpm builds for
>>> Fedora failed today like this:
>> 
>> Hi, thanks for the report.
>>> ""
>>> In file included from ./include/linux/spinlock.h:63,
>>>                  from ./include/linux/mmzone.h:8,
>>>                  from ./include/linux/gfp.h:7,
>>>                  from ./include/linux/mm.h:7,
>>>                  from mm/slub.c:13:
>>> mm/slub.c: In function ‘__pcs_replace_empty_main’:
>>> mm/slub.c:4727:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’?
>>>  4727 |         lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock));
>>>       |                                                                ^~~~~
>>> ./include/linux/lockdep.h:392:61: note: in definition of macro ‘lockdep_assert_held’
>>>   392 | #define lockdep_assert_held(l)                  do { (void)(l); } while (0)
>>>       |                                                             ^
>>> [...]
>>> mm/slub.c:5653:29: note: in expansion of macro ‘this_cpu_ptr’
>>>  5653 |         lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock));
>>>       |                             ^~~~~~~~~~~~
>>> make[3]: *** [scripts/Makefile.build:287: mm/slub.o] Error 1
>>> make[2]: *** [scripts/Makefile.build:556: mm] Error 2
>>> make[2]: *** Waiting for unfinished jobs....
>>> make[1]: *** [/builddir/build/BUILD/kernel-6.17.0-build/kernel-next-20250828/linux-6.17.0-0.0.next.20250828.432.vanilla.fc44.x86_64/Makefile:2017: .] Error 2
>>> make: *** [Makefile:256: __sub-make] Error 2
>>> ""
>>>
>>> Full log: https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-x86_64/09498568-next-next-all/builder-live.log.gz
>> 
>> Oh so I assume the .config here has both LOCKDEP and PREEMPT_RT?
> 
> PREEMPT_RT yes, LOCKDEP no.

Ah right the compiler evaluates that assert param even if not enabled.
> The config the failed build actually used is generated on the buildsys,
> but it should be identical to the one I attached here when you process
> it with olddefconfig.
> 
>> I tried to make lockdep_assert_held() with trylock but forgot about the RT
>> difference. The solution is Alexei's patch
>> 
>> https://lore.kernel.org/all/20250718021646.73353-2-
>> [email-masked]/
> 
> Hmmm, that one didn't do the trick for me.

Yeah it won't help alone, the lockdep_assert_held() calls in this patch will
also need to remove the ".llock" part. But if we did that without Alexei's
patch, it would fix RT but break !RT.