raw_atomic_..._add_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, welcome to the Kernel API Manual ✨ β€” the page header says raw_atomic_..._add_relaxed(9), but the function you actually came here for is raw_atomic_long_fetch_add_relaxed. It's an atomic add with relaxed ordering, and yes, it's kind of a whole mood. πŸ’…


✨ SYNOPSIS ✨

long raw_atomic_long_fetch_add_relaxed (long i , atomic_long_t *v );

🌸 ARGUMENTS 🌸

  • i β€” the long value you're adding. It's the amount going into the atomic add, bestie.
  • v β€” a pointer to an atomic_long_t. This is the atomic thing getting updated.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this function atomically updates v to (v + i) with relaxed ordering. Atomic, relaxed, done. No cap.

It's safe to use in noinstr code β€” iconic β€” but the page says prefer atomic_long_fetch_add_relaxed elsewhere. So yes, this is the one for the noinstr situation; for other spots, the manual is pointing you at atomic_long_fetch_add_relaxed. 🫢

πŸ”₯ RETURN πŸ”₯

The original value of v, returned to you. It's giving "here's what it was before I changed it" energy. 😭

⭐ SEE ALSO ⭐

Kernel file: ./include/linux/atomic/atomic-long.h

The whole atomic-long extended universe is here, periodt:


Okay that's the whole page, bestie 🫢. It's from the Kernel API Manual, with footer source/version ./include/linux/atomic and date October 2026. Now go forth and add atomically, relaxed-style πŸ’…βœ¨

πŸ“¦ where this page comes from