list_for_eac...try_from_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the type * 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 the list_node within 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:

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