atomic64_fetch_add_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 atomic64_fetch_add_relaxed 🌸

okay bestie, welcome to the atomic64_fetch_add_relaxed(9) page from the Kernel API Manual β€” yes that whole mouthful is the name, we're being ✨official✨ today. Grab your iced coffee, this one's short but it's important. 🫢


πŸ’– NAME πŸ’–

atomic64_fetch_add_relaxed β€” an atomic add, but make it relaxed about ordering πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 atomic64_fetch_add_relaxed (s64 i , atomic64_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” the s64 value you're adding, like the little number you're dropping into the pot πŸ“
  • v β€” pointer to the atomic64_t, aka the thing getting updated, the main character of this operation πŸ‘‘

⭐ DESCRIPTION ⭐

So here's the tea β˜•: this function atomically updates v to (v + i) β€” with relaxed ordering. Atomically means nobody can sneak in halfway and catch it mid-update, no cap. Relaxed ordering means it's not out here doing extra memory-barrier theatre, it's just doing the add and moving on. 🧚

⚠️ careful, bestie: this one is unsafe to use in noinstr code. If you're in that neck of the woods, use raw_atomic64_fetch_add_relaxed there instead. Not optional, fr fr. 😭

πŸ”₯ RETURN πŸ”₯

The original value of v. Not the new one, not the updated one β€” the one from before the add. It's giving "I remember who you were before" energy πŸ’€βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-instrumented.h, plus literally the entire atomic extended universe 🌈:

the atomic_ girlies:

the atomic64_ squad (our home team πŸ’œ):

the atomic_long_ cousins (same energy, different width πŸ¦‹):


and that's the whole page, bestie πŸŽ€ this lil guy lives in ./include/linux/atomic, the doc is dated October 2026, and it goes by atomic64_fetch_add_relaxed(9) β€” okay bye, go be atomic responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from