list_entry_rcu(9)
π list_entry_rcu(9) β the Kernel API Manual page you didn't know you needed
okay so bestie, welcome to the Kernel API Manual, and today's main character is list_entry_rcu(9) β a tiny little macro that pulls the whole struct out of a list node and honestly? it's giving underrated icon behavior. π
β¨ NAME β¨
list_entry_rcu β get the struct for this entry π«Ά
like, you've got a struct list_head sitting there being all mysterious, and this thing is like "girl, I know your enclosing struct, come here." π
πΈ SYNOPSIS πΈ
list_entry_rcu (ptr , type , member );
that's it. three args. no drama. no cap. π¦
π ARGUMENTS π
ptrβ thestruct list_headpointer. this is your entry point, the little list node you're starting from. lowkey the whole vibe depends on it. βtypeβ the type of the struct this is embedded in. yes, the outer struct β the one that's holding thelist_headlike a secret. πmemberβ the name of thelist_headwithin the struct. the actual field name, fr fr, not a guess, not a vibe β the literal name. π―
π₯ DESCRIPTION π₯
okay so here's the tea π: this primitive may safely run concurrently with the _rcu list-mutation primitives β think list_add_rcu and its whole friend group β as long as it's guarded by rcu_read_lock.
β οΈ bestie, read that again: guarded by rcu_read_lock. that's not a suggestion, that's the whole assignment. no lock, no safety. periodt. π
it's not doing anything flashy, it's just doing its one job correctly, which is honestly main character energy. π§
π SEE ALSO π
Kernel file ./include/linux/rculist.h β and the entire RCU list cinematic universe, assembled for your reading pleasure:
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_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_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)
and that's the page!! π«Ά this little darling lives in ./include/linux, dated October 2026 β so yeah, mark your calendars, she's timeless. go forth and list_entry_rcu responsibly, bestie. πβ¨π
π¦ 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