raw_atomic_l...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_add_return_relaxed πŸ’…

okay so bestie, this is a page straight out of the Kernel API Manual (section 9, kernel internals, the good stuff ✨) and we're talking about raw_atomic_long_add_return_relaxed. Yes the header truncates it to raw_atomic_l...turn_relaxed because the terminal is a hater, but we know the full name, iykyk 🫢


✨ NAME ✨

raw_atomic_long_add_return_relaxed β€” atomic add with relaxed ordering πŸ”₯


✨ SYNOPSIS ✨

long raw_atomic_long_add_return_relaxed (long i , atomic_long_t *v );

🌸 ARGUMENTS 🌸

  • i β€” a long value, aka the number you're adding. the amount. the contribution. πŸ’–
  • v β€” pointer to the atomic_long_t. this is the thing getting updated, the main character of this whole operation πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does: it atomically updates v to (v + i), with relaxed ordering. no cap, that's the whole vibe. πŸ’…

Also, it's safe to use in noinstr code β€” which lowkey matters a lot, but outside of that, bestie, prefer atomic_long_add_return_relaxed instead. it's right there in the name-adjacent friend group πŸŽ€


⭐ RETURN ⭐

The updated value of v. that's your new number, freshly calculated, hand-delivered 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-long.h β€” go look at it, it's got the whole family in there 🧚

like, the whole extended family showed up. iconic behavior, honestly 🫢


fr fr though: this page lives at ./include/linux/atomic in the source tree, dated October 2026, and the title is raw_atomic_l...turn_relaxed(9). that's it, that's the page. slay, go add some longs atomically πŸ’œπŸŽ€
πŸ“¦ where this page comes from