rcuref_get(9)
π 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 π
- Kernel file
./include/linux/rcuref.h rcuref_init(9)rcuref_read(9)rcuref_is_dead(9)rcuref_put_rcusafe(9)rcuref_put(9)
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
- 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