raw_atomic6...turn_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, welcome to the Kernel API Manual, section 9 β€” this one's called raw_atomic64_dec_return_acquire, and it's the atomic decrement with acquire ordering. that's the whole vibe. one job, does it atomically, returns the new number. πŸŽ€


✨ SYNOPSIS ✨

s64 raw_atomic64_dec_return_acquire (atomic64_t *v );

copy it exactly like that, spaces and all, because we do not freestyle function signatures in this house 🫢


🧚 ARGUMENTS 🧚

  • v β€” pointer to atomic64_t. that's it, that's the whole argument. just a pointer to the thing you're about to decrement. keep it safe, keep it aligned, keep it cute πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

so what does it actually do? it atomically updates v to (v - 1) with acquire ordering. atomically means no other thread can catch it mid-decrement and see some cursed in-between value β€” it's giving main character energy, nobody sees the messy part ✨

the acquire ordering part is doing real work, so don't tune it out: the ordering is part of the contract, not decoration.

it is safe to use in noinstr code. but like β€” if you're not in noinstr code, prefer atomic64_dec_return_acquire instead. the raw_ version is the special-occasion one, not your everyday fit πŸ‘‘

🌈 RETURN 🌈

the updated value of v. as in, the value after the decrement, not the old one. so s64. no surprises, no drama πŸ’œ


🌸 SEE ALSO 🌸

the kernel file that actually lives here: ./include/linux/atomic/atomic-arch-fallback.h β€” that's the address, go say hi πŸ¦‹

and now. bestie. brace yourself. the friend group is massive:

like I said. huge friend group. iykyk πŸ˜­πŸ’€


and that's the page!! mwah πŸ’‹ this lil doc came from ./include/linux/atomic and it's stamped October 2026 β€” so yeah, future-dated and thriving. go decrement something atomically, bestie, and do it with acquire ordering β­πŸ’–

πŸ“¦ where this page comes from