rcuref_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rcuref_get(9) β€” like, the Kernel API Manual girlies finally got a reference-counter page

okay so bestie, welcome to the rcuref_get(9) page. this is the one that grabs you one (1) reference on an rcuref reference count. grabby hands, but make it kernel-safe 🫢


✨ NAME ✨

rcuref_get β€” acquire one reference on a rcuref reference count. that's it, that's the whole job πŸ’–


✨ SYNOPSIS ✨

bool rcuref_get (rcuref_t *ref );

✨ ARGUMENTS ✨

  • ref β€” pointer to the reference count. yes, the reference count. the one we're about to be obsessed with ✨

✨ DESCRIPTION ✨

so this is similar to atomic_inc_not_zero, except it saturates at RCUREF_MAXREF. so it will not just keep climbing forever like your unread notifications β€” it caps out, no cap πŸ“ˆπŸ’€

it provides no memory ordering. ngl, that's on purpose: it is assumed the caller has already guaranteed the object memory to be stable (RCU, etc.). like, the object has to be staying put, that's your job, bestie, not this function's 😌

what it does provide is a control dependency, and thereby it orders future stores. see the documentation in lib/rcuref.c for the whole lore 🧚

and fr fr: it returns true if a reference was successfully acquired. iconic behaviour, honestly πŸ’…


✨ RETURN ✨

False if the attempt to acquire a reference failed. this happens when the last reference has been put already β€” like showing up to the party after everyone's gone home πŸ˜­πŸ’€


🌈 SEE ALSO 🌈

the whole rcuref friend group, honestly. go say hi πŸ’œ


⚠️ reminder bestie: no memory ordering here. you gotta bring the stability yourself (RCU, etc.) or things get real undefined-vibes real fast πŸ™ˆ

and that's the page!! mwah πŸ’‹ this one came from ./include/linux, October 2026, and it's giving main character energy in the Kernel API Manual. slay, go acquire your references responsibly πŸŽ€πŸ¦‹β­

πŸ“¦ where this page comes from