Skip to content

Commit 451c3a0

Browse files
arndbPeter Zijlstra
authored andcommitted
rcu: Mark lockdep_assert_rcu_helper() __always_inline
There are some configurations in which lockdep_assert_rcu_helper() ends up not being inlined, for some reason. This leads to a link failure because now the caller tries to pass a nonexistant __ctx_lock_RCU structure: ld: lib/test_context-analysis.o: in function `test_rcu_assert_variants': test_context-analysis.c:(.text+0x275c): undefined reference to `RCU' ld: test_context-analysis.c:(.text+0x276c): undefined reference to `RCU_BH' ld: test_context-analysis.c:(.text+0x2774): undefined reference to `RCU_SCHED' I saw this in one out of many 32-bit arm builds using gcc-15.2, but it probably happens in others as well. Mark this function as __always_inline to fix the build. Fixes: fe00f6e ("rcu: Support Clang's context analysis") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Paul E. McKenney <paulmck@kernel.org> Link: https://patch.msgid.link/20260202095507.1237440-1-arnd@kernel.org
1 parent b682b70 commit 451c3a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/rcupdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static inline void rcu_preempt_sleep_check(void) { }
435435

436436
// See RCU_LOCKDEP_WARN() for an explanation of the double call to
437437
// debug_lockdep_rcu_enabled().
438-
static inline bool lockdep_assert_rcu_helper(bool c, const struct __ctx_lock_RCU *ctx)
438+
static __always_inline bool lockdep_assert_rcu_helper(bool c, const struct __ctx_lock_RCU *ctx)
439439
__assumes_shared_ctx_lock(RCU) __assumes_shared_ctx_lock(ctx)
440440
{
441441
return debug_lockdep_rcu_enabled() &&

0 commit comments

Comments
 (0)