RCU_INITIALIZER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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