rcu_head_after_call_rcu(9)
π 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β thercu_headstructure you're testing, bestie. this is the one we're asking about.fβ the function that got passed tocall_rcualong withrhp. 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:
same_state_synchronize_rcu(9)cond_resched_tasks_rcu_qs(9)rcu_softirq_qs_periodic(9)RCU_LOCKDEP_WARN(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)
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
- 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