raw_atomic64..._inc_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ raw_atomic64..._inc_acquire(9) πŸŽ€

okay so bestie, you're in the Kernel API Manual and this page is specifically about raw_atomic64_fetch_inc_acquire β€” yes the title up top is abbreviated with the little ... and honestly that's just how it is, don't come for me πŸ’…

it's a tiny page, it's an icon, let's go πŸ¦‹


✨ NAME ✨

raw_atomic64_fetch_inc_acquire β€” atomic increment, but make it acquire ordering 🌸


🧚 SYNOPSIS 🧚

s64 raw_atomic64_fetch_inc_acquire (atomic64_t *v );

that's the whole signature, she's compact, she's precise, she's giving minimalism 🫢


πŸ’– ARGUMENTS πŸ’–

  • v β€” pointer to atomic64_t. yeah. that's the vibe. a pointer, to an atomic64_t, that's the whole thing πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea: this function atomically updates v to (v + 1) with acquire ordering. atomic, meaning nobody gets to catch her mid-increment, no cap πŸ’€

and then the part you actually need to remember: it is safe to use in noinstr code β€” prefer atomic64_fetch_inc_acquire elsewhere. like, elsewhere is elsewhere's problem, noinstr is this function's whole moment πŸ‘‘

lowkey important: the "prefer atomic64_fetch_inc_acquire elsewhere" part is not a suggestion, it's the documented guidance. raw_ is the specialist, not the default ✨

⭐ RETURN ⭐

the original value of v β€” as in the value from before the increment. she gives you the past, then she moves on. main character behaviour fr fr πŸ’…


🌈 SEE ALSO 🌈

kernel file: ./include/linux/atomic/atomic-arch-fallback.h β€” that's where she lives, that's her address 🏠

and now, the friend group. literally everyone. buckle up bestie, this list is long and every single one of them is invited to the group chat πŸ‘‘:

like I said. everyone. ate and left no crumbs πŸŒΈπŸ’€


and that's the page, bestie 🫢 this little love letter lives in the source dir <code>./include/linux/atomic</code> and the date on it is October 2026 β€” go forth, increment atomically, and remember: raw_ is for noinstr, atomic64_fetch_inc_acquire is for everywhere else πŸ’œβœ¨

πŸ“¦ where this page comes from