hlist_replace_rcu(9)
π hlist_replace_rcu β like, the Kernel API Manual page you actually wanna read π
okay so bestie, we're in the Kernel API Manual today and this one is genuinely a little icon. short, sweet, does exactly one thing. let's go β¨
β¨ NAME β¨
hlist_replace_rcu β swap the old entry out for the new one, no cap π«Ά
πΈ SYNOPSIS πΈ
void hlist_replace_rcu (struct hlist_node *old , struct hlist_node *new
);
like yes, that's the whole signature. two pointers, no return value, void behavior, we love a low-maintenance king π
π¦ ARGUMENTS π¦
oldβ the element that's getting replaced. she's leaving the group chat πnewβ the new element to insert. main character energy, stepping in π
π DESCRIPTION π
so the old entry gets replaced with the new entry, and it happens atomically from the perspective of concurrent readers β that's the whole vibe. readers literally cannot tell a swap happened mid-flight, it's giving invisible sleight of hand β¨
but listen β it is the caller's responsibility to synchronize with concurrent updaters, if any. that part is on you, bestie, not on the function. don't come for her when you skipped the sync step π
π§ SEE ALSO π§
the rculist.h girlies, from the kernel file ./include/linux/rculist.h π
list_for_each_rcu(9)list_tail_rcu(9)list_add_rcu(9)list_add_tail_rcu(9)list_del_rcu(9)list_bidir_del_rcu(9)hlist_del_init_rcu(9)list_replace_rcu(9)list_splice_rcu(9)__list_splice_init_rcu(9)list_splice_init_rcu(9)list_splice_tail_init_rcu(9)list_entry_rcu(9)list_first_or_null_rcu(9)list_next_or_null_rcu(9)list_for_each_entry_rcu(9)list_for_each_entry_srcu(9)list_entry_lockless(9)list_for_each_entry_lockless(9)list_for_each_entry_continue_rcu(9)list_for_each_entry_from_rcu(9)hlist_del_rcu(9)hlists_swap_heads_rcu(9)hlist_add_head_rcu(9)hlist_add_tail_rcu(9)hlist_add_before_rcu(9)hlist_add_behind_rcu(9)hlist_for_each_entry_rcu(9)hlist_for_each_entry_srcu(9)hlist_for_each_entry_rcu_notrace(9)hlist_for_each_entry_rcu_bh(9)hlist_for_each_entry_continue_rcu(9)hlist_for_each_entry_continue_rcu_bh(9)hlist_for_each_entry_from_rcu(9)
that's the whole page, bestie, go forth and swap safely π₯π
mwah π β sourced fresh from ./include/linux, dated October 2026, and that's the hlist_replace_rcu(9) tea, periodt πβ
π¦ 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