raw_atomic64..._sub_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64..._sub_release(9) πŸ’…

okay so you're in the Kernel API Manual, bestie, and this page is literally titled raw_atomic64..._sub_release(9) β€” no cap, that's the whole header. Buckle up πŸŽ€


✨ NAME ✨

raw_atomic64_fetch_sub_release β€” atomic subtract, but make it release ordering πŸ’«


🌸 SYNOPSIS 🌸

s64 raw_atomic64_fetch_sub_release (s64 i , atomic64_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an s64, and it's the value you're subtracting. the amount getting yeeted πŸ’€
  • v β€” pointer to atomic64_t. the main character we're updating 🫢

πŸ’– DESCRIPTION πŸ’–

okay so picture this: it atomically updates v to (v - i) with release ordering. that's the vibe. the way it does the whole thing in one atomic little move is iconic, fr.

it's safe to use in noinstr code β€” but lowkey, everywhere else? prefer atomic64_fetch_sub_release instead. like it's not wrong, it's just not the one you should be texting first πŸ‘€


πŸ”₯ RETURN πŸ”₯

the original value of v β€” like, the value before your subtraction happened. it gives you receipts, periodt πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

first up, the source file on the kernel side:

  • ./include/linux/atomic/atomic-arch-fallback.h

and now… the entire friend group 🌈 the 32-bit raw_atomic_* girlies:

and the 64-bit raw_atomic64_* crew 🧚 (yes, including this page itself, self-love only):


real talk: this whole page lives in ./include/linux/atomic and it's stamped October 2026. go be atomic, bestie πŸ“βœ¨

anyway that's the page, ily, go read the whole kernel now πŸ’œπŸ«ΆπŸŽ€

πŸ“¦ where this page comes from