rcu_replace_pointer(9)
π rcu_replace_pointer β the Kernel API Manual glow-up π
okay bestie, welcome to the Kernel API Manual entry for rcu_replace_pointer(9), and no cap, this one's a little two-for-one deal and it's lowkey iconic β¨
πΈ NAME πΈ
rcu_replace_pointer β swap out an RCU pointer and hand you back the old value, like a bestie trading scrunchies π
π¦ SYNOPSIS π¦
rcu_replace_pointer (rcu_ptr , ptr , c );
that's it. that's the whole vibe. three things go in, one gets slotted into place, one comes back out π
π ARGUMENTS π
rcu_ptrβ the RCU pointer in question. she's the main character here, because her old value is what gets returned to you π«Άptrβ your regular, non-RCU-annotated pointer. this is the new thing sliding into position β¨cβ the lockdep conditions, like the exact circumstances under which the dereference is gonna happen. it's giving "show your work" energy π
π DESCRIPTION π
so here's the tea, bestie: this does a replacement. rcu_ptr is an RCU-annotated pointer, and c is the lockdep argument that gets passed along to the rcu_dereference_protected call that's used to read that pointer π
then, the way that it works: the old value of rcu_ptr is returned to you, and rcu_ptr is set to ptr. that's literally it. old value out, new value in, slay π₯
β SEE ALSO β
all the friends in the group chat, and they are all under Kernel file ./include/linux/rcupdate.h π§
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_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)rcu_head_after_call_rcu(9)
ngl, that's a lot of links, but every single one of them is a real one, bestie. no invented friends here π
and that's the whole page, babe π sign-off time: this one lives in ./include/linux, dated October 2026, and it's filed under rcu_replace_pointer(9) β go off, you understood the assignment ππ
π¦ 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