hlist_nulls_...ch_entry_rcu(9)
β¨ hlist_nulls_...ch_entry_rcu(9) β¨
Okay so bestie, welcome to the Kernel API Manual π β today we're looking at this icon of a macro, hlist_nulls_for_each_entry_rcu. Yes, the header truncated it, no, that's not a vibe, just how it is. π
πΈ NAME πΈ
hlist_nulls_for_each_entry_rcu β iterate over rcu list of given type π¦
β SYNOPSIS β
hlist_nulls_for_each_entry_rcu (tpos , pos , head , member );
She's giving "four things, in that order, don't @ me" π
π ARGUMENTS π
tposβ the *type ** you're gonna use as a loop cursor π like, that's your main character pointer, fr fr.posβ thestruct hlist_nulls_nodeyou use as a loop cursor. yes bestie, there are two cursors, they're both doing their job.headβ the head of the list π the literal start of everything.memberβ the name of thehlist_nulls_nodeinside the struct. you're telling it where to find the node, iykyk π
π₯ DESCRIPTION π₯
So here's the tea β β the barrier in there is needed to make sure the compiler doesn't cache the first element [1], because this loop can be restarted [2]. lowkey crucial, ngl. π
- [1]
Documentation/memory-barriers.txtaround line 1533 - [2]
Documentation/RCU/rculist_nulls.rstaround line 146
Go read those two, they ate. πβ¨
π«Ά SEE ALSO π«Ά
Kernel file ./include/linux/rculist_nulls.h β and her whole extended friend group, no cap:
hlist_nulls_del_init_rcu(9)hlist_nulls_first_rcu(9)hlist_nulls_next_rcu(9)hlist_nulls_pprev_rcu(9)hlist_nulls_del_rcu(9)hlist_nulls_add_head_rcu(9)hlist_nulls_add_tail_rcu(9)hlist_nulls_replace_rcu(9)hlist_nulls_replace_init_rcu(9)hlist_nulls_for_each_entry_safe(9)
π· okay that's the whole page, bestie π· β brought to you by ./include/linux, dropping October 2026, filed under hlist_nulls_...ch_entry_rcu(9). mwah π 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