list_entry_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct list_head pointer. 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 the list_head like a secret. πŸ‘‘
  • member β€” the name of the list_head within 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:


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