rhl_for_each_entry_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« 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 β€” the struct rlist_head to 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 the struct rlist_head within 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