rcu_read_lock_bh_held(9)
π rcu_read_lock_bh_held(9) π
okay so bestie, welcome to the Kernel API Manual β¨ this one's a lil function from the kernel's RCU corner of the universe and honestly it's giving "are we even in the right place right now?" energy π«Ά
πΈ NAME πΈ
rcu_read_lock_bh_held β lowkey asking: might we be in an RCU-bh read-side critical section? π€
β¨ SYNOPSIS β¨
int notrace rcu_read_lock_bh_held (void );
like, that's the whole vibe. int notrace, takes nothing, returns an int π
π ARGUMENTS π
voidβ no arguments, bestie. zero. nada. the function said "I don't need input, I'm the main character" ππ
π¦ DESCRIPTION π¦
okay so what it actually does: it checks whether bottom half is disabled, and that one check covers both the CONFIG_PROVE_RCU case and the not case π₯ like, one check, both worlds, slay.
β οΈ heads up though β if someone uses rcu_read_lock_bh, but then later enables BH, then lockdep (if it's enabled) will show the situation. so like, it will snitch. not in a mean way, just in a "lockdep is watching" way π
this whole thing is useful for debug checks in functions that require that they be called within an RCU read-side critical section β basically the function gets to be like "am I being called correctly rn or is this a disaster?" πβ¨
it also checks debug_lockdep_rcu_enabled so we don't get false positives during boot β because boot is chaotic enough already, no cap π
π«Ά and one more thing: rcu_read_lock_bh is disallowed if the CPU is either idle or offline from an RCU perspective, so this function checks for those as well. fr fr, both of them.
π SEE ALSO π
kernel file ./kernel/rcu/update.c and honestly the whole friend group π:
rcu_read_lock_held_common(9)rcu_async_hurry(9)rcu_async_relax(9)rcu_expedite_gp(9)rcu_unexpedite_gp(9)rcu_read_lock_held(9)wakeme_after_rcu(9)init_rcu_head_on_stack(9)destroy_rcu_head_on_stack(9)get_completed_synchronize_rcu(9)
and that's the page!! πβ¨ this lil icon came to you from ./kernel/rcu and the October 2026 release, so likeβ¦ remember where you got it from, mwah ππ¦π
π¦ 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