hlist_unhashed_lockless(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hlist_unhashed_lockless(9) β€” Kernel API Manual

okay so bestie, this is a page from the Kernel API Manual and it's about exactly one (1) little function. She's small. She's niche. She's lowkey iconic. Let's get into it 🫢


✨ NAME ✨

hlist_unhashed_lockless β€” the version of hlist_unhashed made for lockless use, no cap

So yeah, it's the same vibe check as hlist_unhashed, just built different so you can run it when there's no lock holding your hand πŸŽ€


🌸 SYNOPSIS 🌸

int hlist_unhashed_lockless (const struct hlist_node *h );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • h β€” the node you wanna check, bestie. That's it. That's the whole argument πŸ’…

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea β˜• β€” this is a variant of hlist_unhashed, and you must use this one in lockless contexts to dodge potential load-tearing. Like, not "should", not "maybe", must. This is the whole reason she exists 🧚

The way it works is the READ_ONCE in here is paired with the various WRITE_ONCE calls in the hlist helpers that are defined below πŸ‘‡ β€” so the reads and writes are matching sets, iykyk. Not me being obsessed with memory ordering at 3am 😭πŸ”₯

fr fr, if you're in a lockless context and you reach for plain hlist_unhashed instead of her, that's a load-tearing situation waiting to happen. read the room πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/list.h β€” and then the whole friend group, because these list helpers literally never leave each other's side 🌈


and that's the whole page, bestie πŸ“ it's giving "one function, one job, zero tearing" and honestly? we love a focused queen πŸ‘‘

this absolute icon lives over in ./include/linux and the version we're looking at is October 2026 β€” so yeah, mark your calendar, screenshot the receipt, and go use the lockless version in your lockless code πŸ’œβœ¨

πŸ“¦ where this page comes from