rht_for_each_rcu_from(9)
β¨ rht_for_each_rcu_from β¨
okay bestie, so this is a page from the Kernel API Manual and it's literally about rht_for_each_rcu_from(9) β a macro that walks an RCU hash chain starting from a head you pick. it's giving "loop cursor era" and honestly? iconic. π
πΈ SYNOPSIS πΈ
rht_for_each_rcu_from (pos , head , tbl , hash );
like, that's the whole call. four things in, vibe check complete. π
π¦ ARGUMENTS π¦
posβ thestruct rhash_headyou're using as your loop cursor. she's the main character that moves down the chain, keep an eye on her πheadβ thestruct rhash_headyou start from. your launch point, your origin story, your "we begin here" β¨tblβ thestruct bucket_table. the whole bucket situation this chain lives in πͺ£hashβ the hash value / bucket index. which bucket we're in, no cap π’
π DESCRIPTION π
okay so this is a hash chain list-traversal primitive, and here's the important part: it may safely run concurrently with the _rcu mutation primitives β like rhashtable_insert β as long as the traversal is guarded by rcu_read_lock. π«Ά
not me stressing the rcu_read_lock part β girl, do NOT skip the guard, that's the whole deal π
π SEE ALSO π
so many siblings, she's from a big family fr fr:
- Kernel file
./include/linux/rhashtable.hstruct bucket_table(9) rht_grow_above_75(9)rht_shrink_below_30(9)rht_grow_above_100(9)rht_grow_above_max(9)rht_for_each_from(9)rht_for_each(9)rht_for_each_entry_from(9)rht_for_each_entry(9)rht_for_each_entry_safe(9)rht_for_each_rcu(9)rht_for_each_entry_rcu_from(9)rht_for_each_entry_rcu(9)rhl_for_each_rcu(9)rhl_for_each_entry_rcu(9)rhashtable_lookup(9)rhashtable_lookup_fast(9)rhltable_lookup(9)rhashtable_insert_fast(9)rhltable_insert_key(9)rhltable_insert(9)rhashtable_lookup_insert_fast(9)rhashtable_lookup_get_insert_fast(9)rhashtable_lookup_insert_key(9)rhashtable_lookup_get_insert_key(9)rhashtable_remove_fast(9)rhltable_remove(9)rhashtable_replace_fast(9)rhltable_walk_enter(9)rhltable_free_and_destroy(9)
and that's the page, bestie! π§ this lil drop came straight out of ./include/linux and it's stamped October 2026 β so yeah, rht_for_each_rcu_from(9), see you in the kernel ππ₯
π¦ 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