rcu_head_after_call_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rcu_head_after_call_rcu(9) β€” a Kernel API Manual moment

okay so bestie, welcome to the Kernel API Manual, and today's main character is rcu_head_after_call_rcu(9). yes the whole vibe is a manpage, and yes it's lowkey iconic. let's get into it ✨


🌸 NAME 🌸

rcu_head_after_call_rcu β€” literally the question "has this rcu_head been passed to call_rcu()?" and nothing else. that's the whole assignment. πŸŽ€


✨ SYNOPSIS ✨

bool rcu_head_after_call_rcu (struct rcu_head *rhp , rcu_callback_t f );

that's it. that's the function. no cap. πŸ¦‹


🫢 ARGUMENTS 🫢

  • rhp β€” the rcu_head structure you're testing, bestie. this is the one we're asking about.
  • f β€” the function that got passed to call_rcu along with rhp. like, the callback that was promised. 🀝

πŸ’œ DESCRIPTION πŸ’œ

So here's the tea. This function returns true if rhp has been passed to call_rcu with func, and false otherwise. That's it, that's the whole deal, slay. πŸ’…

BUT β€” and this is important, don't skip this part β€” it emits a warning in any other case, including the case where rhp has already been invoked after a grace period. so like, if the situation isn't one of those two clean answers, you're getting a warning. it's giving "vibe check failed" 😭

🚨 Also for real: calls to this function must not race with callback invocation. Like, do not let those two things happen at the same time. No racing. That's the rule.

One way to avoid such races is to enclose the call to rcu_head_after_call_rcu in an RCU read-side critical section that includes a read-side fetch of the pointer to the structure containing rhp. That's the recommended move, periodt. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/rcupdate.h β€” and the whole squad, in order, no one left behind:


okay and before you go β€” little sign-off moment πŸŽ€ This page lives in ./include/linux, and it's dated October 2026, filed under rcu_head_after_call_rcu(9). mwah, go read the source bestie, iykyk πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from