latch_tree_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– latch_tree_insert(9) πŸ’–

ok so this is from the Kernel API Manual, bestie β€” welcome to the latch-tree corner of the kernel, it's giving very demure, very mindful, very lock-free πŸ’…

✨ NAME ✨

latch_tree_insert β€” insert @node into the trees @root 🌸

πŸ¦‹ SYNOPSIS πŸ¦‹

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

like literally that's the whole signature, no notes, she's iconic πŸ‘‘

πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” the node(s) to insert 🫢
  • root β€” the trees you're inserting node into, yes plural, it's a whole vibe 🌈
  • ops β€” the operators that define the node order, i.e. who goes where ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” it inserts node into root in an ordered fashion, such that we can always observe one complete tree. no cap. and like, if you want the full lore, see the comment for write_seqcount_latch_begin πŸ‘€

the inserts use rcu_assign_pointer to publish the element, so that the tree structure is stored before we can observe the new node. order matters, bestie, it's giving main character energy πŸ”₯

⚠️ and this is the important bit: all modifications (latch_tree_insert, latch_tree_remove) are assumed to be serialized. assumed. don't come crying to me if you skip that part πŸ˜­πŸ’€

🌟 SEE ALSO 🌟


ok that's the page, mwah πŸ’‹ β€” sourced from ./include/linux, dated October 2026, and the page itself is latch_tree_insert(9). go forth and insert responsibly, bestie πŸ«Άβœ¨πŸ“

πŸ“¦ where this page comes from