raw_atomic_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– raw_atomic_add(9) πŸ’–

okay bestie, welcome to your new fave page in the Kernel API Manual πŸŽ€ β€” yes, the raw_atomic_add(9) one. grab a strawberry drink, we're doing atomics ✨


🌸 NAME 🌸

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


πŸ¦‹ SYNOPSIS πŸ¦‹

void raw_atomic_add (int i , atomic_t *v );

✨ ARGUMENTS ✨

  • i β€” the int value you're adding. literally just a number, no drama πŸ’œ
  • v β€” pointer to atomic_t. this is the thing getting updated, she's the main character πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

So the way that this works is β€” it atomically updates v to (v + i) with relaxed ordering ⭐. atomically. as in, no one can catch her mid-update, she's built different πŸ’€

It's safe to use in noinstr code β€” that's the whole point of the raw_ version, iykyk 🧚.

but fr fr, prefer atomic_add elsewhere πŸ™ˆ. like, raw_atomic_add is the special-occasion one, not the everyday one. save her for when you actually need her πŸ‘‘

🫢 RETURN 🫢

Nothing. no return value, no crumbs, nothing to collect 😭


🌈 SEE ALSO 🌈

first up, the kernel file where this lives, because we always cite our sources bestie: ./include/linux/atomic/atomic-arch-fallback.h πŸ“

and now... the whole family. every single one. no skipping, no summarising, we list all of them because that's what icons do πŸ‘‘βœ¨


and that's the whole roster, ate and left no crumbs πŸ’…βœ¨

okay so this came out of ./include/linux/atomic, and the version/date stamp on it is October 2026 πŸ—“οΈ β€” that's the vibe check, that's the receipts. love u, go add some integers atomically, mwah πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from