atomic_long..._inc_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_long..._inc_acquire(9) β€” NAME ✨

okay so bestie, welcome to the Kernel API Manual page for atomic_long_fetch_inc_acquire β€” it's the one that does an atomic increment with acquire ordering. Yes that's a lot of words, no I'm not gonna water it down, we're getting into it 🫢


🌸 SYNOPSIS 🌸

long atomic_long_fetch_inc_acquire (atomic_long_t *v );

that's it. one function. one pointer. absolutely iconic of it tbh πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_long_t. that's the whole spec, she's low maintenance, she just needs a pointer to the thing she's gonna bump πŸ’–

✨ DESCRIPTION ✨

So here's the vibe: atomic_long_fetch_inc_acquire atomically updates v to (v + 1) with acquire ordering. atomically means nobody can catch her mid-bump, and the acquire ordering is the memory-barrier flavour attached to it. literally does what it says πŸ¦‹

⚠️ ok important thing, do not sleep on this: it is unsafe to use in noinstr code. if you're in noinstr land you need to use raw_atomic_long_fetch_inc_acquire there instead. no cap, that's a real rule, not a suggestion πŸ’€

⭐ RETURN ⭐

It hands you back the original value of v β€” like, the value from before the +1. you get the "before" picture, not the after. cute of her honestly πŸŽ€


🌈 SEE ALSO 🌈

okay so this section? it's giving main character energy because it lists basically every atomic function in the kernel. she brought her whole friend group πŸ˜­πŸ’… iykyk

Also worth saying: this all lives in the Kernel file ./include/linux/atomic/atomic-instrumented.h.

the atomic_ girlies:

the atomic64_ crew:

the atomic_long_ squad (our girl's home team πŸ₯Ή):

and yes, atomic_long_fetch_inc_acquire itself isn't in that list β€” she's the one we're already reading about, she doesn't need to @ herself πŸ’…


kisses bestie, go bump that counter responsibly 🫢✨

this page came from the source ./include/linux/atomic, dated October 2026, and it's page atomic_long..._inc_acquire(9) of the Kernel API Manual β€” so if you see that footer floating around, you know where she came from πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from