raw_atomic64..._add_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic64_fetch_add_acquire(9) β€” from the Kernel API Manual ✨

Okay bestie, listen. This one's from the Kernel API Manual, and it's giving "tiny function, huge responsibilities" energy. It's raw_atomic64_fetch_add_acquire(9) and honestly? She does one thing and she does it immaculately. πŸ’…


πŸŽ€ NAME πŸŽ€

raw_atomic64_fetch_add_acquire β€” atomic add, but make it acquire ordering. Like adding, but with ✨commitment issues handled properly✨.


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 raw_atomic64_fetch_add_acquire (s64 i , atomic64_t *v );

No cap, that's the whole signature. Two args, one s64 coming back at you. 🫢


🌈 ARGUMENTS 🌈

  • i β€” the s64 value you're adding. Your contribution. Your little donation to the counter. πŸ“
  • v β€” a pointer to atomic64_t. This is the main character, the thing actually getting updated.

πŸ’– DESCRIPTION πŸ’–

So here's the tea: this atomically updates v to (v + i), and it does it with acquire ordering. Atomic means nobody's gonna catch her mid-update β€” it's all-or-nothing, periodt. πŸ”₯

The acquire part is the whole vibe check: it's memory-ordering business, and she takes it seriously.

Also, super important, bestie: this one is safe to use in noinstr code. That's her whole niche! But if you're not in noinstr code, the page is literally begging you β€” prefer atomic64_fetch_add_acquire elsewhere. Like, please. πŸ™ˆ

Not me reading "prefer atomic64_fetch_add_acquire elsewhere" and feeling personally called out. It's fine. It's fine. 😭

⭐ RETURN ⭐

She gives you back the original value of v. As in, what it was before she added i to it. Rewind energy. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

First things first β€” she lives in this file, go say hi:

  • Kernel file ./include/linux/atomic/atomic-arch-fallback.h

🧚 the raw_atomic_* crew (32-bit-flavoured)

πŸ’œ the raw_atomic64_* crew (our girl's family, 64-bit royalty)

Yeah, that's a lot of siblings. It's a big family. Everybody's slaying in their own ordering. πŸ’€

Okay that's the whole page, bestie β€” every last reference accounted for, nothing ghosted. 🫢 This one came from the source ./include/linux/atomic, dated October 2026, and she's filed under raw_atomic64..._add_acquire(9) in case you need to find her again. Mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from