RCU_INITIALIZER(9)
β¨ NAME β¨
RCU_INITIALIZER β the macro that statically initializes an RCU-protected global variable π
β¨
so like. this page is from the Kernel API Manual (section 9, bestie, kernel devs only) and honestly it's short but it ate. let's get into it π«Ά
π SYNOPSIS π
RCU_INITIALIZER (v );
that's literally it. no cap, that's the whole thing π
πΈ ARGUMENTS πΈ
vβ the value you're statically initializing with. that's the arg. that's the whole arg. give her a value and she's good to go π
π¦ SEE ALSO π¦
okay this is the part where the page goes full main-character-ensemble-cast π β it's all in the kernel file ./include/linux/rcupdate.h, and the squad is deep:
first up, the synchronization girlies: same_state_synchronize_rcu(9), cond_resched_tasks_rcu_qs(9), rcu_softirq_qs_periodic(9).
then the lockdep police π: 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).
then the pointer-handling icons π
: unrcu_pointer(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).
then the lock/unlock besties π₯: 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).
then the sibling initializers (iykyk) π§: RCU_INIT_POINTER(9), RCU_POINTER_INITIALIZER(9).
and finally the free-the-memory crew π: kfree_rcu(9), kfree_rcu_mightsleep(9), kfree_rcu_nolock(9), rcu_head_init(9), rcu_head_after_call_rcu(9).
like I said. full ensemble cast. every single one of them is invited to the group chat π
ngl, if RCU still confuses you, that's valid β it's giving final-boss energy. but you found this page, so you're already doing great π₯Ή
mwah, love u, go initialize something safely π β this page ships from ./include/linux, dated October 2026 π
π¦ 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