atomic_fetch_inc_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, welcome to atomic_fetch_inc_acquire(9) β€” she lives in the Kernel API Manual and she is the atomic increment with acquire ordering. one (1) job, done flawlessly, no notes πŸ‘‘

atomic_fetch_inc_acquire β€” atomic increment with acquire ordering.


🌸 SYNOPSIS 🌸

int atomic_fetch_inc_acquire (atomic_t *v );

like, that's the whole vibe. short. iconic. moving on πŸ’–


✨ ARGUMENTS ✨

  • v β€” pointer to atomic_t. that's it. that's the whole argument list. one pointer, main character energy 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is: atomically update v to (v + 1) with acquire ordering. atomically means nobody can catch her mid-increment, and acquire ordering means the memory ordering is handled so you don't have to think about it (iykyk) ⭐

🚨 real talk though: she is unsafe to use in noinstr code β€” like, do not. use raw_atomic_fetch_inc_acquire there instead. this is not a drill, this is literally in the manual πŸ’€

πŸ’œ RETURN πŸ’œ

the original value of v β€” aka the value from before the increment, bestie. she gives you the receipts from before she touched anything πŸŽ€


🌈 SEE ALSO 🌈

ok so the family reunion is huge and everyone showed up. the kernel file lives at ./include/linux/atomic/atomic-instrumented.h and here's the entire guest list, in order, no gatekeeping:

the atomic_* girlies πŸ“

the atomic64_* squad (same energy, bigger numbers, still slaying) πŸ”₯

the atomic_long_* crew (long may she reign πŸ‘‘)


and that's the whole page bestie, no crumbs left behind 🧚

signing off from ./include/linux/atomic, dated October 2026, this was atomic_fetch_inc_acquire(9) β€” hydrate, read your memory barriers, and stay atomic πŸ’…βœ¨

πŸ“¦ where this page comes from