raw_atomic_l...turn_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_sub_return_acquire β€” Kernel API Manual ✨

okay so bestie, you've stumbled into the kernel's atomic-long corner of the manual, and honestly? iconic. this is the raw_atomic_long_sub_return_acquire(9) page and it's shorter than my attention span, so let's go πŸŽ€


✨ NAME ✨

raw_atomic_long_sub_return_acquire β€” atomic subtract with acquire ordering πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

long raw_atomic_long_sub_return_acquire (long i , atomic_long_t *v );

🌸 ARGUMENTS 🌸

  • i β€” a long value, and it's the one getting subtracted. the amount coming off the top, basically πŸ“
  • v β€” pointer to an atomic_long_t. this is the poor little variable getting math'd on 🫢

πŸ’œ DESCRIPTION πŸ’œ

So the way this works: it atomically updates v to (v - i) β€” all in one shot, no half-states, no drama β€” and it does it with acquire ordering ✨

it's giving "I need to see everything that happened before this before I move on", iykyk.

And the important bit, no cap: it's safe to use in noinstr code. but if you're anywhere else, prefer atomic_long_sub_return_acquire instead πŸ‘‘ (yes, the non-raw_ one β€” that's the whole point of the raw_ prefix, it's the "I know what I'm doing" version πŸ’…)


⭐ RETURN ⭐

returns the updated value of v β€” like, after the subtraction, freshly baked πŸ”₯


🌈 SEE ALSO 🌈

first off, the kernel file this bad boy lives in: ./include/linux/atomic/atomic-long.h 🧚

and then… the whole friend group 😭 literally the entire atomic-long roster, here we go:

periodt. that's the whole list, no skips, no cuts πŸ’€βœ¨


okay that's the whole page and you ate that ngl πŸ’… this lil doc came from ./include/linux/atomic and it's dated October 2026 β€” so jot that down, bestie, and go subtract some longs with acquire ordering like the main character you are πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from