raw_atomic_..._dec_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_..._dec_relaxed (9) β€” Kernel API Manual vibes 🌸

okay bestie, so we're in the Kernel API Manual today and the page we're reading is raw_atomic_..._dec_relaxed(9). yes the title is literally abbreviated with dots, it's giving mysterious. stay with me, it's actually cute.


✨ NAME ✨

raw_atomic_long_fetch_dec_relaxed β€” atomic decrement, but make it relaxed ordering. she's chill like that πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

long raw_atomic_long_fetch_dec_relaxed (atomic_long_t *v );

that's the whole signature, no cap. one pointer in, one long out. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • v β€” pointer to atomic_long_t. that's it. that's the argument. she's pointing at the thing we're about to decrement πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

so what does she do. atomically updates v to (v - 1) with relaxed ordering. literally just "subtract one, but make it atomic, and don't be dramatic about memory barriers". the way that it's atomic AND relaxed? main character energy fr fr ✨

also important bestie: it's safe to use in noinstr code. but like β€” prefer atomic_long_fetch_dec_relaxed everywhere else. this raw one is for the special occasions (iykyk) πŸ‘‘

🌈 RETURN 🌈

returns the original value of v β€” so like, the value before the decrement, not after. she gives you the receipt from before the purchase, not the new balance. iconic behavior honestly πŸ’€πŸ’–


🧚 SEE ALSO 🧚

okay this is the part where the manpage goes absolutely feral and lists the entire atomic long family. every single sibling. get comfy, we're going through the whole group chat πŸ’œ

like. eighty-four of them. the atomic long family ate and left no crumbs πŸ‘‘πŸ”₯


and that's the page bestie!! πŸŽ€ the source path is ./include/linux/atomic, the date on this one is October 2026, and the whole thing belongs to the Kernel API Manual (that's the manual name, in case you were wondering where the header line went β€” it's right here, folded in like a little bow πŸŽ€). mwah, go decrement something responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from