latch_tree_insert(9)
π 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 insertingnodeinto, 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 π
- Kernel file
./include/linux/rbtree_latch.hπ struct latch_tree_ops(9)π¦latch_tree_erase(9)πΈlatch_tree_find(9)β
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
- 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