rcu_head_init(9)
π rcu_head_init(9) π
okay so bestie, welcome to the Kernel API Manual β yes that's the actual manual name, we're in the big leagues now π this one's a tiny little function but it's load-bearing, so listen up π
β¨ NAME β¨
rcu_head_init β the glow-up ritual you do on an rcu_head so that rcu_head_after_call_rcu() can actually tell you what's going on later π
πΈ SYNOPSIS πΈ
void rcu_head_init (struct rcu_head *rhp );
that's it. that's the whole vibe. one pointer, no return, no drama.
π¦ ARGUMENTS π¦
rhpβ thestruct rcu_headyou're initializing. like, the actual structure, hand it over, she needs the setup π«Ά
π DESCRIPTION π
okay so picture this: you're planning to call rcu_head_after_call_rcu later to test whether a given rcu_head structure has already been passed to call_rcu. cute, love that for you. but here's the thing β you must also invoke this rcu_head_init function on it just after allocating that structure. no skipping, no "I'll do it later", do it right after alloc. periodt π
β οΈ and this is the important part, bestie, don't let it slide: calls to this function must not race with calls tocall_rcu,rcu_head_after_call_rcu, or callback invocation. like, not even a little. racing is not it. it's giving undefined behaviour and you do not want that energy π
so yeah β init it early, init it clean, and don't let anything else touch it while you do π
π SEE ALSO π
- Kernel file
./include/linux/rcupdate.hβ and literally the entire RCU family reunion, all invited: 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_after_call_rcu(9)
and that's the whole page, bestie, you ate that π
sign-off time π§ this lil gem lives in the source tree at ./include/linux and it's stamped October 2026 β so like, mark your calendar, the rcu_head_init(9) girlies are thriving π
β¨π
π¦ 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