list_for_eac...try_from_rcu(9)
π NAME π
okay so this is list_for_eac...try_from_rcu(9) from the Kernel API Manual, and it's literally the iterator for iterate over a list from current point. bestie, it lets you walk the tail of a list starting wherever you already are, and that's the whole serve. β¨
β¨ SYNOPSIS β¨
the signature is giving:
list_for_each_entry_from_rcu (pos , head , member );
π ARGUMENTS π
posβ thetype *to use as a loop cursor. this is your current main character node. πheadβ the head for your list. the icon that anchors the whole friend group. π«Άmemberβ the name of thelist_nodewithin the struct. yep, the exact field name, no guessing. π―
π¦ DESCRIPTION π¦
This iterator walks over the tail of a list starting from a given position. But bestie, hear me: that position must have been in the list when the RCU read lock was taken. not just "was in the list at some point" β it has to have been there when the lock was taken, fr fr. π
Typically that means one of two things, and you need one of them: either you obtained the node from a previous walk of the list in the same RCU read-side critical section, or you held some sort of non-RCU reference (such as a reference count) to keep the node alive and in the list. both alive and still in the list β the italicized and is doing important work, don't skip it. π₯
This iterator is similar to list_for_each_entry_continue_rcu, except this one starts from the given position and that one starts from the position after the given position. the way that's literally the one-step difference, iykyk. π
π SEE ALSO π
Kernel file ./include/linux/rculist.h is where the magic lives, and here's the whole squad:
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)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_rcu_bh(9)hlist_for_each_entry_continue_rcu(9)hlist_for_each_entry_continue_rcu_bh(9)hlist_for_each_entry_from_rcu(9)
mwah π cute sign-off time: source/version ./include/linux, date October 2026, page list_for_eac...try_from_rcu(9). periodt. π«Ά
π¦ 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