radix_tree_...ot_protected(9)
π radix_tree_deref_slot_protected β bestie's guide to dereferencing a slot (with the lock held, obvi)
okay so this is a page from the Kernel API Manual β section 9, kernel stuff β and it's literally the most specific little function ever. it's giving "i do one thing and i do it well" energy. let's get into it β¨
πΈ NAME πΈ
radix_tree_deref_slot_protected β dereference a slot with tree lock held π
like. that's the whole job. deref a slot. with the lock. held. periodt.
π¦ SYNOPSIS π¦
void * radix_tree_deref_slot_protected (void __rcu **slot , spinlock_t
*treelock );
so it returns a void *, takes a void __rcu **slot and a spinlock_t *treelock. that's it, that's the signature, no cap π«Ά
π ARGUMENTS π
slotβ the slot pointer, returned byradix_tree_lookup_slot. yes bestie you gotta get it from there first, this function isn't out here making slots out of thin air πtreelockβ and the caller must hold this spinlock. not optional. not a suggestion. hold it. π
π DESCRIPTION π
lowkey this is basically radix_tree_deref_slot's sibling β very similar vibes, same family. β¨
the difference? the caller does not hold the RCU read lock. instead, the caller must hold the tree lock, so parallel updates don't come in and wreck the vibe. think of it as "different lock, same goal" β protect the read, prevent parallel updates. π₯
bestie if you're not holding the tree lock, none of this is protected and that's a bad time. the name isn't a suggestion π
β RETURN β
the entry stored in that slot. that's the whole point. that's what you came for π
π§ SEE ALSO π§
so there's a whole radix-tree friend group and honestly they're all iconic:
- Kernel file
./include/linux/radix-tree.h struct radix_tree_iter(9)- Radix-tree synchronization(9)
radix_tree_deref_slot(9)radix_tree_deref_retry(9)radix_tree_exception(9)radix_tree_iter_init(9)radix_tree_next_chunk(9)radix_tree_iter_lookup(9)radix_tree_iter_retry(9)radix_tree_iter_resume(9)radix_tree_chunk_size(9)radix_tree_next_slot(9)radix_tree_for_each_slot(9)radix_tree_for_each_tagged(9)
like okay go off radix tree family tree π³π
that's the whole page bestie β from the kernel source tree at ./include/linux, dated October 2026. go forth and hold your locks responsibly π«Άπ
β¨
π¦ 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