hlist_nulls_del_init_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hlist_nulls_del_init_rcu β€” the Kernel API Manual moment πŸŽ€

Okay bestie, so we're in hlist_nulls_del_init_rcu(9) territory β€” that's the kernel manual, yes, and this function deletes an entry from a hash list with re-initialization. Like, it removes the node AND resets it. Iconic double duty. ✨


🌸 SYNOPSIS 🌸

void hlist_nulls_del_init_rcu (struct hlist_nulls_node *n );

Literally that's it. That's the whole signature. Go off, king. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • n β€” the element to delete from the hash list. Just hand over your struct hlist_nulls_node * and let her cook. πŸ“

πŸ’– NOTE πŸ’–

So here's the tea, and you need to hear it: after this runs, hlist_nulls_unhashed on the node returns true. That's the whole point, and it's highkey useful for RCU-based read lockfree traversal β€” specifically when the writer side has to know whether the list entry is still hashed or already unhashed. Vibes check: is she still in the list or not? Now you know. πŸ’β€β™€οΈ

And in particular β€” this is the important bit, don't skip it β€” it means we can not poison the forward pointers, because those may still be used for walking the hash list. So instead we can only zero the pprev pointer, so that list_unhashed will return true after this. That's the move. That's the whole move. πŸ™ˆ

Now for the cautionary part, because we keep it real here: the caller must take whatever precautions are necessary (such as holding appropriate locks) to avoid racing with another list-mutation primitive β€” things like hlist_nulls_add_head_rcu or hlist_nulls_del_rcu β€” running on this same list. No cap, that's on you. πŸ”₯

However πŸ’« β€” and this is the slay part β€” it is perfectly legal to run concurrently with the _rcu list-traversal primitives, such as hlist_nulls_for_each_entry_rcu. Traversal besties can read while you delete. That's the RCU lifestyle. 🌈

⚠️ Fr fr though: mutation primitives racing on the same list without your own locking precautions = not the vibe. Lock it down first, bestie. πŸ”’

⭐ SEE ALSO ⭐

Kernel file ./include/linux/rculist_nulls.h, plus the whole squad β€” go give them a follow:


And that's the whole page, mwah πŸ’‹ β€” brought to you from ./include/linux, dated October 2026, and yes this is hlist_nulls_del_init_rcu(9) signing off. Periodt. πŸ’…πŸ«Ά

πŸ“¦ where this page comes from