atomic64_fetch_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_fetch_inc(9) β€” from the Kernel API Manual ✨

okay so bestie, we're in the Kernel API Manual, section 9, and today's main character is atomic64_fetch_inc. she's a little function with a big job and honestly? she ate. πŸŽ€


🌸 NAME 🌸

atomic64_fetch_inc β€” atomic increment with full ordering πŸ’–

like, she bumps your number up by one, atomically, and she does not cut corners on ordering. periodt.


✨ SYNOPSIS ✨

s64 atomic64_fetch_inc (atomic64_t *v );

that's it. that's the whole vibe check. one arg, returns an s64, slay. πŸ¦‹


🫢 ARGUMENTS 🫢

  • v β€” pointer to atomic64_t. yeah. that's the whole description. she's a pointer, she points at an atomic64_t, we love her for it. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

Atomically updates v to (v + 1) with full ordering.

no cap, that's the whole thing: the value goes up by exactly one, nobody can catch her mid-update, and the ordering is full β€” not relaxed, not acquire, not release, full. main character energy fr fr. πŸ’…

⚠️ okay so important safety moment: it is unsafe to use in noinstr code. if you're in noinstr land, use raw_atomic64_fetch_inc there instead. don't be the person who ignores this, i'm literally begging. 😭

⭐ RETURN ⭐

The original value of v. πŸ“

like β€” she increments it, but what she hands back to you is what it was before the bump. the before picture. the pre-slime. iconic behaviour honestly.


🌈 SEE ALSO 🌈

okay so this list is a whole journey, buckle up bestie. also heads up: the kernel file is ./include/linux/atomic/atomic-instrumented.h β€” that's where all this lives. 🧚

the atomic_* girlies (32-bit era):


πŸ¦‹ the atomic64_* fam (our girl's actual household) πŸ¦‹


πŸ’œ the atomic_long_* cousins, still iconic πŸ’œ


πŸŽ€ sign-off πŸŽ€

that's the whole page bestie, and yes it really did come from the file ./include/linux/atomic, dated October 2026, and the page itself is atomic64_fetch_inc(9). go forth, increment atomically, respect the noinstr warning, and remember β€” full ordering or nothing. mwah. πŸ’‹ slay 🌈✨

πŸ“¦ where this page comes from