hlist_for_each_entry_rcu_bh(9)
β¨ hlist_for_each_entry_rcu_bh β¨
Okay bestie, so this one's a kernel API manual page (hlist_for_each_entry_rcu_bh, section 9) and honestly it's giving niche but powerful π¦. If you've ever needed to loop over an RCU-protected hlist without everything falling apart, this is your girl.
π NAME π
hlist_for_each_entry_rcu_bh β literally just iterate over an rcu list of given type π
πΈ SYNOPSIS πΈ
hlist_for_each_entry_rcu_bh (pos , head , member );
π ARGUMENTS π
posβ thetype *you're using as your loop cursor. main character energy fr, she's the one moving through the list β¨headβ the head of your list, the starting point, the VIP entrance π«Άmemberβ the name of thehlist_nodeinside the struct. iykyk, it's how we get from the node back to the thing π
π¦ DESCRIPTION π¦
So this list-traversal primitive can safely run concurrently with the _rcu list-mutation primitives β stuff like hlist_add_head_rcu β as long as the traversal is guarded by rcu_read_lock. No cap. That's the whole vibe check: guard it with rcu_read_lock and you're slaying, skip the guard and it's giving undefined chaos π
β οΈ Bestie please remember: the safety here is conditional. rcu_read_lock is not optional, it's the whole point π
β SEE ALSO β
All the siblings and cousins, in the kernel file ./include/linux/rculist.h β obsessed with how many of these there are π
list_for_each_rcu(9)list_tail_rcu(9)list_add_rcu(9)list_add_tail_rcu(9)list_del_rcu(9)list_bidir_del_rcu(9)hlist_del_init_rcu(9)list_replace_rcu(9)list_splice_rcu(9)__list_splice_init_rcu(9)list_splice_init_rcu(9)list_splice_tail_init_rcu(9)list_entry_rcu(9)list_first_or_null_rcu(9)list_next_or_null_rcu(9)list_for_each_entry_rcu(9)list_for_each_entry_srcu(9)list_entry_lockless(9)list_for_each_entry_lockless(9)list_for_each_entry_continue_rcu(9)list_for_each_entry_from_rcu(9)hlist_del_rcu(9)hlist_replace_rcu(9)hlists_swap_heads_rcu(9)hlist_add_head_rcu(9)hlist_add_tail_rcu(9)hlist_add_before_rcu(9)hlist_add_behind_rcu(9)hlist_for_each_entry_rcu(9)hlist_for_each_entry_srcu(9)hlist_for_each_entry_rcu_notrace(9)hlist_for_each_entry_continue_rcu(9)hlist_for_each_entry_continue_rcu_bh(9)hlist_for_each_entry_from_rcu(9)
πβ¨ and that's the page!! β¨π
This little icon lives in ./include/linux and the page is dated October 2026 β so yeah, cry about it, the kernel docs are from the future π°οΈπ. Catch you in the next manpage, bestie, mwah ππ
π¦ 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