atomic_long_...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_long_add_return_relaxed(9) β€” Kernel API Manual 🫢

okay so bestie, you know the atomic family? this is the long branch of the family tree, and the one we're talking about today is the add-and-give-me-the-new-value one β€” but make it relaxed ✨. it lives in ./include/linux/atomic/atomic-instrumented.h, and honestly? iconic. let's get into it.


✨ NAME ✨

atomic_long_add_return_relaxed β€” atomic add with relaxed ordering πŸ’«

🌸 SYNOPSIS 🌸

long atomic_long_add_return_relaxed (long i , atomic_long_t *v );

πŸ’– ARGUMENTS πŸ’–

  • i β€” the long value you're adding. literally just the number going in πŸ“
  • v β€” pointer to the atomic_long_t. the victim. the target. the main character πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

It atomically updates v to (v + i) with relaxed ordering. that's it, that's the whole vibe ✨ no drama, no extra steps, and the whole thing happens atomically so nobody can sneak in mid-update πŸ’…

⚠️ okay important heads-up bestie: this is unsafe to use in noinstr code. if you're in noinstr land, use raw_atomic_long_add_return_relaxed there instead. don't be messy about it πŸ™ˆ

⭐ RETURN ⭐

The updated value of v. so you get the after number, not the before one β€” no fetch_ in the name means no sneaky old-value souvenir πŸ”₯

πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./include/linux/atomic/atomic-instrumented.h β€” and bestie, brace yourself, the whole family reunion is here 😭 every single one of these, fr fr:


and that's the whole page, bestie 🧚 go forth and add your longs atomically πŸ’œ

sign-off tea β˜•: this little love letter comes from the kernel file ./include/linux/atomic, dated October 2026, and it's page atomic_long_...turn_relaxed(9) of the Kernel API Manual πŸŽ€ mwah πŸ’‹

πŸ“¦ where this page comes from