latch_tree_erase(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

latch_tree_erase β€” ok so bestie, this one removes @node from the trees @root ✨ (yes the tree*s*, plural, we'll get to that, it's giving very main character energy 🌈)

This is the latch_tree_erase(9) page from the Kernel API Manual, and honestly? She ate. Let's go 🫢


✨ SYNOPSIS

void latch_tree_erase (struct latch_tree_node *node , struct
       latch_tree_root *root , const struct latch_tree_ops *ops );

Three args, no return value, no notes. She's void, she's confident, she's literally iconic πŸ’…


πŸŽ€ ARGUMENTS

  • node β€” the nodes to remote 🫠 (that's the page's exact wording, I'm not gonna gaslight you β€” it means the node you're getting rid of, bestie). One node in, no node out πŸ’€
  • root β€” the trees to remove node from 🌳🌳 yes, trees, plural, keep reading.
  • ops β€” the operators that define the node ordering. She's the vibe check for where things land πŸ‘‘

πŸ¦‹ DESCRIPTION

So this removes the node from the trees in root, and it does it in an ordered fashion β€” the whole point being that we can always observe one complete tree πŸ‘€βœ¨ No half-deleted cursed in-between state, no "not me mid-erase" energy, periodt. And if you want the full lore on why that matters, see the comment for write_seqcount_latch_begin πŸ“–

⚠️ Two big assumptions, do not skip these, I'm serious 😭 One: it is assumed that node will observe one RCU quiescent state before being reused of freed (that's the original wording β€” "of freed", she's doing her best πŸ₯² you know what it means). Two: all modifications (latch_tree_insert, latch_tree_remove) are assumed to be serialized. Like, one at a time, take turns, be polite β€” no chaotic group-chat overlap πŸ™ˆ

🌸 SEE ALSO

  • Kernel file ./include/linux/rbtree_latch.h β€” that's where the whole latch tree family lives 🏠
  • struct latch_tree_ops(9) β€” the ordering operators from the arguments πŸ’œ
  • latch_tree_insert(9) β€” her sister, the one who puts things in ⭐
  • latch_tree_find(9) β€” her other sister, the one who finds things πŸ”

Ok that's the whole page, you're caught up πŸ§šπŸ’– Sourced from the ./include/linux directory, dated October 2026, under the latch_tree_erase(9) name β€” mwah, go read write_seqcount_latch_begin's comment, iykyk πŸ“πŸ‘‘

πŸ“¦ where this page comes from