rcu_replace_pointer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🧚


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