RCU_LOCKDEP_WARN(9)
π RCU_LOCKDEP_WARN β bestie edition
okay so this is the kernel API manual page for RCU_LOCKDEP_WARN, and yes it's a manpage, and yes it's giving "9" (kernel section, iykyk). Sit down, grab a strawberry drink π, we're gonna get through this together.
β¨ NAME β¨
RCU_LOCKDEP_WARN β the little gremlin that goes and emits a lockdep splat if the specified condition is met π
Like. It's a warning-dispenser. You hand it a condition, and if that condition is true, it yells at you through lockdep. That's the whole vibe.
π¦ SYNOPSIS π¦
RCU_LOCKDEP_WARN (c , s );
that's it. two args. two tiny little args. and yet. π
π ARGUMENTS π
cβ the condition you want checked. this is the thing that gets evaluated. if it comes back true, bestie, we have opinions.sβ the informative message. this is what gets said when the splat happens, so make it actually informative, okay? it's your one chance to be helpful π
πΈ DESCRIPTION πΈ
Okay so here's the actual lore, and it's lowkey kind of genius. β¨
Before it even looks at (c), this thing checks debug_lockdep_rcu_enabled. Why? Because during early boot, lockdep hasn't been initialized yet, and if you just went straight in and checked (c) you'd get splats that are fully not the vibe β noisy, pointless, embarrassing. So it does the vibe check first. π«Ά
Then it checks (c).
And then β and this is the part that genuinely ate β it rechecks debug_lockdep_rcu_enabled after checking (c). Because there's a race window where lockdep could get disabled in between, and without that second check you'd get false-positive splats. Not me getting blamed for a splat caused by a race ππ
See commit 3066820034b5dd ("rcu: Reject RCU_LOCKDEP_WARN false positives") for more detail β like, the literal receipts. go read it. it's iconic.
ngl the whole design is just: check, look, check again. three-step skincare routine for splats. π§΄
π SEE ALSO π
The kernel file ./include/linux/rcupdate.h has the whole friend group. Here's the entire crew, no cap, all of them:
same_state_synchronize_rcu(9)cond_resched_tasks_rcu_qs(9)rcu_softirq_qs_periodic(9)lockdep_assert_in_rcu_read_lock(9)lockdep_assert_in_rcu_read_lock_bh(9)lockdep_assert_in_rcu_read_lock_sched(9)lockdep_assert_in_rcu_reader(9)unrcu_pointer(9)RCU_INITIALIZER(9)rcu_assign_pointer(9)rcu_replace_pointer(9)rcu_access_pointer(9)rcu_dereference_check(9)rcu_dereference_bh_check(9)rcu_dereference_sched_check(9)rcu_dereference_all_check(9)rcu_dereference_protected(9)rcu_dereference(9)rcu_dereference_bh(9)rcu_dereference_sched(9)rcu_dereference_all(9)rcu_pointer_handoff(9)rcu_read_lock(9)rcu_read_unlock(9)rcu_read_lock_bh(9)rcu_read_unlock_bh(9)rcu_read_lock_sched(9)rcu_read_unlock_sched(9)RCU_INIT_POINTER(9)RCU_POINTER_INITIALIZER(9)kfree_rcu(9)kfree_rcu_mightsleep(9)kfree_rcu_nolock(9)rcu_head_init(9)rcu_head_after_call_rcu(9)
thirty-five of them. thirty-five!! the way this function has more friends than me ππ
anyway bestie, that's the whole page. go emit your splats responsibly. π
source:./include/linuxΒ· dated October 2026 Β· sectionRCU_LOCKDEP_WARN(9)β mwah, love u, bye πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms