atomic_long..._dec_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_long..._dec_release(9) β€” the Kernel API Manual, bestie edition πŸŽ€

Okay so this is the manual page for atomic_long..._dec_release(9) from the Kernel API Manual, and honestly? It's a little baddie with one job and she does it flawlessly. Let's get into it ✨


🌸 NAME 🌸

atomic_long_fetch_dec_release β€” atomic decrement, but make it release-ordered πŸ’…


⭐ SYNOPSIS ⭐

long atomic_long_fetch_dec_release (atomic_long_t *v );

That's it. That's the whole vibe check. One pointer in, one long out 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • v β€” pointer to atomic_long_t. Yeah. That's the whole argument. She's low-maintenance like that, no cap πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

So what does she do? Atomically updates v to (v - 1) with release ordering. The way that works is she takes the value, subtracts one, and does it atomically β€” nobody gets to sneak a peek at a half-finished decrement, periodt. And the release ordering is doing its whole memory-barrier main-character moment so the ordering guarantees stay intact πŸ’–

πŸ’€ Warning, bestie, listen up: this one is unsafe to use in noinstr code. Like, do not. If you're in noinstr territory, use raw_atomic_long_fetch_dec_release there instead. That's literally what it's for. iykyk πŸ™ˆ

🌈 RETURN 🌈

She returns the original value of v β€” the value from before the decrement. So she gives you the past and the future at the same time. Iconic behavior honestly πŸ‘‘


🧚 SEE ALSO 🧚

Grab a snack, bestie, because this list is long long 😭 β€” it all lives in the kernel file ./include/linux/atomic/atomic-instrumented.h:

🌸 the plain atomic_* girlies

πŸ’œ the atomic64_* icons

πŸ¦‹ the atomic_long_* queens (our girl's whole family)


πŸ’– and that's the whole page, bestie πŸ’–

This cutie lives in ./include/linux/atomic, dated October 2026 β€” go drink some water and decrement responsibly πŸ“πŸ«Ά

πŸ“¦ where this page comes from