atomic_long_...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ atomic_long_dec_return_relaxed β€” Kernel API Manual, section 9 ✨

okay so bestie, you found the atomic_long_...turn_relaxed(9) page β€” welcome to the Kernel API Manual, section 9, the little corner of the docs where atomics live. this one's a single-function baddie and honestly? she's lowkey iconic. let's go πŸ’…


🌸 NAME 🌸

atomic_long_dec_return_relaxed β€” atomic decrement with relaxed ordering

like, she decrements. atomically. relaxed-ly. and she returns. the whole package πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

long atomic_long_dec_return_relaxed (atomic_long_t *v );

yes the spacing is doing whatever it wants, that's just how the manpage came, don't come for her 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_long_t. that's it. that's the whole argument. she's low maintenance ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so what she actually does: she atomically updates v to (v - 1) with relaxed ordering. one clean little decrement, no drama, no extra memory-barrier nonsense around it. it's giving efficiency πŸ’…

⚠️ no cap, important: she's unsafe to use in noinstr code. like, genuinely. if you're in noinstr land, use raw_atomic_long_dec_return_relaxed there instead. do not finesse this, fr fr 😭

⭐ RETURN ⭐

she gives you back the updated value of v. so if v was 7, you get 6. if it was 0... well, she decremented it, that's all we're saying πŸ“


πŸ”₯ SEE ALSO πŸ”₯

the receipts first β€” Kernel file ./include/linux/atomic/atomic-instrumented.h.

and then, bestie, the entire extended family. i'm not exaggerating, this is the whole group chat. buckle up πŸ’€

🌈 the atomic_* crew

🧚 the atomic64_* era

πŸ‘‘ the atomic_long_* squad (our girl's family)


and that's the whole page bestie, you ate that πŸ’–βœ¨

this cutie lives at source ./include/linux/atomic, dated October 2026, filed under the page title atomic_long_...turn_relaxed(9) β€” section 9 forever πŸ‘‘ bye ily 🫢🌸

πŸ“¦ where this page comes from