RCU_LOCKDEP_WARN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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 Β· section RCU_LOCKDEP_WARN(9) β€” mwah, love u, bye πŸ’‹βœ¨
πŸ“¦ where this page comes from