rhl_for_each_entry_rcu(9)
π« rhl_for_each_entry_rcu β the kernel API manual, but make it make sense π«
okay so bestie, you know how there's a whole manual page for this one macro? yeah. it's the rhl_for_each_entry_rcu situation, from the Kernel API Manual, and we're gonna get through it together π«Ά
β¨ NAME β¨
rhl_for_each_entry_rcu β iterate over rcu hash table list of given type π
like, that's it. that's the whole job. it walks the list, it's rcu-flavored, and it gives you entries of your chosen type. iconic behavior honestly.
π SYNOPSIS π
rhl_for_each_entry_rcu (tpos , pos , list , member );
four things go in, no surprises, no cap π₯
πΈ ARGUMENTS πΈ
tposβ the type * to use as a loop cursor. yes, with the asterisk. it's your little pointer buddy that walks the loop with you, main character energy πposβ thestruct rlist_headto use as a loop cursor. this one's the list-head-shaped cursor, doing the actual chain-walking π¦listβ the head of the list. where the whole journey starts, fr fr β¨memberβ name of thestruct rlist_headwithin the hashable struct. iykyk β you're telling it which field inside your struct is the list link π
π DESCRIPTION π
so this hash chain list-traversal primitive π β and yes, "primitive" is the word, don't come for me β should be used on the list returned by rhltable_lookup.
that's the whole vibe check: it's the thing you reach for after rhltable_lookup hands you a list, and you need to walk that list and get your structs out. literally that's it. slay π
lowkey important: the wording is "should be used on the list returned by rhltable_lookup" β that's the documented target, so don't go pointing it at random lists and then acting surprised π
π SEE ALSO π
the friend group. the whole extended crew. all of them, in the order they were introduced, no exclusions π
Kernel file ./include/linux/rhashtable.h struct 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_from(9), rht_for_each_rcu(9), rht_for_each_entry_rcu_from(9), rht_for_each_entry_rcu(9), rhl_for_each_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)
like, go read them. there's lore π
π§ the sign-off π§
this little masterpiece of documentation lives in ./include/linux, and it's dated October 2026, and the page is rhl_for_each_entry_rcu(9) β so go forth, iterate over that rcu hash table list of given type, and be the cursor you wish to see in the world πβ¨ππ¦πΈ
π¦ 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