hlist_del_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– hlist_del_rcu πŸ’–

okay so bestie, welcome to the Kernel API Manual (section 9, yes it's giving very official) β€” this one's about deletes entry from hash list without re-initialization. slay, let's get into it πŸŽ€


✨ SYNOPSIS ✨

void hlist_del_rcu (struct hlist_node *n );

literally the whole signature, no cap 🫢


🌸 ARGUMENTS 🌸

  • n β€” the element to delete from the hash list. that's the one, the main character of this operation πŸ‘‘

πŸŽ€ NOTE πŸŽ€

okay this part is important, listen up πŸ™ˆ

list_unhashed on entry does not return true after this β€” the entry is left in an undefined state. ngl that sounds scary but it's actually the whole point: it's useful for RCU based lockfree traversal ✨

In particular, it means that we can not poison the forward pointers that may still be used for walking the hash list. like, we just can't, they're still out there being used πŸ’€

The caller must take whatever precautions are necessary (such as holding appropriate locks) to avoid racing with another list-mutation primitive, such as hlist_add_head_rcu or hlist_del_rcu, running on this same list.

that's the "you're on your own for locking, bestie" clause 🫢

But β€” and this is the iconic part β€” it is perfectly legal to run concurrently with the _rcu list-traversal primitives, such as hlist_for_each_entry. yes queen, concurrent read while you delete, that's the vibe check passing 🌈


πŸ’… SEE ALSO πŸ’…

Kernel file ./include/linux/rculist.h, plus this whole friend group right here:


that's the whole page, bestie, you ate it πŸ“

source dir ./include/linux Β· dated October 2026 Β· mwah πŸ’‹ go forth and traverse safely πŸ¦‹

πŸ“¦ where this page comes from