In noticed that linux next-20250828 fails to compile with the following error:
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) | ^ ./include/linux/percpu-defs.h:245:9: note: in expansion of macro ‘__verify_pcpu_ptr’ 245 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:4727:29: note: in expansion of macro ‘this_cpu_ptr’ 4727 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ 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) | ^ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:4727:29: note: in expansion of macro ‘this_cpu_ptr’ 4727 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ 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) | ^ ./arch/x86/include/asm/percpu.h:68:10: note: in expansion of macro ‘TYPEOF_UNQUAL’ 68 | (TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)tcp_ptr__; \ | ^~~~~~~~~~~~~ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:4727:29: note: in expansion of macro ‘this_cpu_ptr’ 4727 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ CC net/ipv4/route.o mm/slub.c: In function ‘__pcs_install_empty_sheaf’: AS lib/crypto/x86/sha1-ni-asm.o CC drivers/acpi/ec.o mm/slub.c:5604:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5604 | 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) | ^ ./include/linux/percpu-defs.h:245:9: note: in expansion of macro ‘__verify_pcpu_ptr’ 245 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:5604:29: note: in expansion of macro ‘this_cpu_ptr’ 5604 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ mm/slub.c:5604:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5604 | 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) | ^ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:5604:29: note: in expansion of macro ‘this_cpu_ptr’ 5604 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ mm/slub.c:5604:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5604 | 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) | ^ ./arch/x86/include/asm/percpu.h:68:10: note: in expansion of macro ‘TYPEOF_UNQUAL’ 68 | (TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)tcp_ptr__; \ | ^~~~~~~~~~~~~ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ mm/slub.c:5604:29: note: in expansion of macro ‘this_cpu_ptr’ 5604 | lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); | ^~~~~~~~~~~~ mm/slub.c: In function ‘__pcs_replace_full_main’: mm/slub.c:5653:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5653 | 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) | ^ ./include/linux/percpu-defs.h:245:9: note: in expansion of macro ‘__verify_pcpu_ptr’ 245 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ 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)); | ^~~~~~~~~~~~ mm/slub.c:5653:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5653 | 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) | ^ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ 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)); | ^~~~~~~~~~~~ mm/slub.c:5653:64: error: ‘local_trylock_t’ {aka ‘__seg_gs struct spinlock’} has no member named ‘llock’; did you mean ‘lock’? 5653 | 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) | ^ ./arch/x86/include/asm/percpu.h:68:10: note: in expansion of macro ‘TYPEOF_UNQUAL’ 68 | (TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)tcp_ptr__; \ | ^~~~~~~~~~~~~ ./include/linux/percpu-defs.h:246:9: note: in expansion of macro ‘arch_raw_cpu_ptr’ 246 | arch_raw_cpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~ ./include/linux/percpu-defs.h:256:27: note: in expansion of macro ‘raw_cpu_ptr’ 256 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ^~~~~~~~~~~ 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)); | ^~~~~~~~~~~~ The reason for this is that local_trylock_t is mapped to spinlock_t on PREEMPT_RT=y and spinlock_t has no member named llock. If one changes the assertion like this the kernel compiles with PREEMPT_RT=y, too, but I'm not sure if the assertion is correctly used here. If not one has to use #ifdef PREEMPT_RT here I think: diff --git a/mm/slub.c b/mm/slub.c index 3ab91a1409f5..2138fecc8d37 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4724,7 +4724,7 @@ __pcs_replace_empty_main(struct kmem_cache *s, struct slub_percpu_sheaves *pcs, struct slab_sheaf *full; bool can_alloc; - lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); + lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock)); if (pcs->spare && pcs->spare->size > 0) { swap(pcs->main, pcs->spare); @@ -5601,7 +5601,7 @@ static void __slab_free(struct kmem_cache *s, struct slab *slab, static void __pcs_install_empty_sheaf(struct kmem_cache *s, struct slub_percpu_sheaves *pcs, struct slab_sheaf *empty) { - lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); + lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock)); /* This is what we expect to find if nobody interrupted us. */ if (likely(!pcs->spare)) { @@ -5650,7 +5650,7 @@ __pcs_replace_full_main(struct kmem_cache *s, struct slub_percpu_sheaves *pcs) bool put_fail; restart: - lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock.llock)); + lockdep_assert_held(this_cpu_ptr(&s->cpu_sheaves->lock)); put_fail = false; Bert Karwatzki