radix_tree_lookup(9)
π radix_tree_lookup(9) π
okay so this is a page from the Kernel API Manual, and bestie, it's all about radix_tree_lookup β the little function that goes "hey, what's at this index?" on a radix tree. let's get into it π
β¨ SYNOPSIS β¨
void * radix_tree_lookup (const struct radix_tree_root *root , unsigned
long index );
yes that's the whole signature, no cap. it hands you back a void *. π«Ά
πΈ ARGUMENTS πΈ
rootβ the radix tree root. like, the actual tree you're digging around in, bestie. π³indexβ the index key. this is the lil address you're asking about. π
π DESCRIPTION π
so basically: look up the item at position index in the radix tree root. that's the whole vibe check. you give it a root and an index, it gives you the thing. iconic behaviour honestly. β¨
now the important bit, and I need you to listen: you can call this function under rcu_read_lock, but β and this is the big but β the caller must manage the lifetimes of leaf nodes. (eg. RCU may also be used to free them safely, which is the whole trick). π§
and the good news? no RCU barriers are required to access or modify the returned item. so like, you don't have to do extra ceremony for that part. we love a low-maintenance lookup. π
fr fr though, the lifetime management of leaf nodes is on you. the function is not gonna do it for you. main character energy means main character responsibility. π
π¦ SEE ALSO π¦
Kernel file ./lib/radix-tree.c, plus this whole friend group right here β like a group chat of related functions, and yes I'm @-ing all of them:
radix_tree_find_next_bit(9)radix_tree_shrink(9)__radix_tree_create(9)radix_tree_insert(9)__radix_tree_lookup(9)radix_tree_lookup_slot(9)__radix_tree_replace(9)radix_tree_replace_slot(9)radix_tree_iter_replace(9)radix_tree_tag_set(9)radix_tree_tag_clear(9)radix_tree_iter_tag_clear(9)radix_tree_tag_get(9)radix_tree_next_chunk(9)radix_tree_gang_lookup(9)radix_tree_gang_lookup_tag(9)radix_tree_gang_lookup_tag_slot(9)radix_tree_iter_delete(9)radix_tree_delete_item(9)radix_tree_delete(9)radix_tree_tagged(9)idr_preload(9)idr_destroy(9)
that's the whole page, bestie, you ate it up. πβ
signing off from ./lib, dated October 2026 β stay slay, stay RCU-safe, and remember: no RCU barriers needed for that returned item ππ
π¦ 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