raw_atomic64..._add_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_fetch_add_relaxed ✨

Ok so bestie, you found a page from the Kernel API Manual and it's giving very specific, very atomic, very relaxed energy. Sit down, hydrate, let's get into it 🫢


🌸 NAME 🌸

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


πŸŽ€ SYNOPSIS πŸŽ€

s64 raw_atomic64_fetch_add_relaxed (s64 i , atomic64_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an s64 value, aka the number you're adding. The lil contribution πŸ“
  • v β€” pointer to atomic64_t, aka where the magic happens. Main character pointer energy πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

So what it does: it atomically updates v to (v + i) β€” and it does that with relaxed ordering, no cap. One clean swoop, nobody sees the in-between state πŸ’«

Here's the part to not skip, bestie: it's safe to use in noinstr code. But if you're not in noinstr code, prefer atomic64_fetch_add_relaxed elsewhere. Like, that's the vibe check β€” this raw one is for the special noinstr situations πŸ™ˆ

Fr fr, read that twice: noinstr-safe is the whole reason this exists. Everywhere else, go use atomic64_fetch_add_relaxed.

⭐ RETURN ⭐

It gives you back the original value of v β€” the value from before the add. So you get the receipts of the past while the future is already updated. Iconic 🀌


🌈 SEE ALSO 🌈

The whole friend group is here, and yes, we're listing every single one because nobody gets left behind πŸ’–


Ok and that's the whole page, bestie πŸ’œ Live from ./include/linux/atomic, dated October 2026, and yes β€” that's the source/version and date, we're doing the cute sign-off thing. Now go forth and add atomically, but, like, relaxed πŸ˜Œβœ¨πŸŽ€

πŸ“¦ where this page comes from