raw_atomic_l...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so bestie, welcome to the raw_atomic_long_sub_return_relaxed(9) page πŸ’– this is from the Kernel API Manual, and it's genuinely one of those little gems that does exactly one thing and does it slayfully. let's get into it πŸŽ€


🌸 NAME 🌸

raw_atomic_long_sub_return_relaxed β€” atomic subtract with relaxed ordering ✨

like, it subtracts, it's atomic, and it's chill about ordering. no cap. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

long raw_atomic_long_sub_return_relaxed (long i , atomic_long_t *v );

that's the whole vibe check right there πŸ‘‘ two args, one long coming back. iconic.


πŸ’œ ARGUMENTS πŸ’œ

  • i β€” a long value to subtract 🌸 like, this is the amount you're taking away.
  • v β€” pointer to an atomic_long_t πŸ’« this is the thing getting updated, iykyk.

⭐ DESCRIPTION ⭐

so what it does: it atomically updates v to (v - i) with relaxed ordering. literally all of it, in one atomic lil moment 🫢

it's safe to use in noinstr code β€” yes that's a real constraint, bestie, not a suggestion 😭 and everywhere else you should prefer atomic_long_sub_return_relaxed instead.

ngl if you're reaching for this outside noinstr code, the page is telling you to go the non-raw_ route. take the hint πŸ’…

πŸ”₯ RETURN πŸ”₯

the updated value of v πŸ’– so you get the new number back, post-subtraction. main character return value tbh.


🌈 SEE ALSO 🌈

kernel file: ./include/linux/atomic/atomic-long.h πŸ“ (that's where the magic lives, fr fr)

and now the whole friend group, because the SEE ALSO list is long long and honestly it ate:

like I said. the whole friend group showed up πŸ˜­πŸ’–


πŸŽ€ and that's the page, bestie! this one comes from ./include/linux/atomic and it's dated October 2026, filed under that iconic raw_atomic_l...turn_relaxed(9) header up top. go forth and subtract atomically βœ¨πŸ’…πŸ¦‹

πŸ“¦ where this page comes from