atomic_fetch_add_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_fetch_add_release β€” like, the whole vibe

okay so bestie, welcome to atomic_fetch_add_release(9), straight out of the Kernel API Manual, section 9. it's a kernel function, it's atomic, and it has opinions about ordering. let's get into it 🫢


✨ NAME ✨

atomic_fetch_add_release β€” atomic add with release ordering

(yeah. that's it. that's the whole name. short, iconic, does exactly what it says πŸ’…)


🌸 SYNOPSIS 🌸

int atomic_fetch_add_release (int i , atomic_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an int value to add. just a number, bestie. it's the thing going in.
  • v β€” pointer to atomic_t. this is the main character right here ✨

πŸ”₯ DESCRIPTION πŸ”₯

so what it actually does: it atomically updates v to (v + i) with release ordering. atomically meaning nobody else can sneak in halfway through and mess with it β€” it's giving locked-in, no cap πŸ”’

the release part is the ordering. that's the whole flair of this function versus its relaxed cousin.

⚠️ okay important, and I mean it: this one is unsafe to use in noinstr code. if you're in noinstr land, use raw_atomic_fetch_add_release there instead. like, that's not a suggestion, that's the rule πŸ™ˆ

πŸ‘‘ RETURN πŸ‘‘

it hands you back the original value of v β€” the value from before the add happened. so you get the receipts of what it used to be πŸ’–


🌈 SEE ALSO 🌈

okay so this next part is a moment. all of these live in the kernel file ./include/linux/atomic/atomic-instrumented.h, and there are a LOT of them. buckle up, bestie πŸŽ€

πŸ¦‹ the plain atomic_* fam

πŸ’œ the atomic64_* era

🧚 the atomic_long_* collection


and that's the whole thing, bestie πŸ’– this page comes to you from ./include/linux/atomic, dated October 2026 β€” so like, mark your calendars, and go forth and add atomically with release ordering. slay πŸŽ€βœ¨

πŸ“¦ where this page comes from