raw_atomic64_dec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_dec(9) β€” Kernel API Manual ✨

okay bestie, so this is a page from the Kernel API Manual and it's about raw_atomic64_dec β€” yes, the lowercase-with-underscores queen herself πŸŽ€ she's a build-your-own building block in the kernel's atomic toolbox, and she's honestly so straightforward it's giving "one job, does it well" energy.


🌸 NAME 🌸

raw_atomic64_dec β€” atomic decrement with relaxed ordering πŸ¦‹

lowkey iconic: minus one, but make it thread-safe.


✨ SYNOPSIS ✨

void raw_atomic64_dec (atomic64_t *v );

literally that's the whole signature. one pointer, no return, no drama πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic64_t 🫢 that's it, that's the whole argument list. it's the thing you're about to knock down by one.

πŸ’– DESCRIPTION πŸ’–

Atomically updates v to (v - 1) with relaxed ordering.

so basically: v goes down by exactly one, and the whole read-modify-write happens atomically β€” nobody can sneak in halfway and catch her mid-decrement 🌈 the ordering is relaxed, meaning she's not out here building fences for you; if you need ordering guarantees, that's a different function's job, iykyk.

Safe to use in noinstr code; prefer atomic64_dec elsewhere.

🚨 okay this is the important part, don't skip it bestie: this one is explicitly safe inside noinstr code. everywhere else? prefer atomic64_dec. that's not a suggestion, that's the manpage talking. fr fr.

πŸ¦‹ RETURN πŸ¦‹

Nothing.

no value, no status, no little gift back. void is void. she decrements and she leaves 🧚✨


πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./include/linux/atomic/atomic-arch-fallback.h β€” that's where she lives in the source tree πŸ‘‘

and now the full family reunion, because the kernel really said "make a variant for every vibe" and meant it 😭 the 32-bit side first:


and now the 64-bit girlies, aka her actual siblings πŸ’œ:


and that's the whole page, bestie, you ate it πŸ’…βœ¨

πŸŽ€ cute little sign-off: this one ships out of ./include/linux/atomic and the page is dated October 2026. go forth and decrement responsibly, mwah πŸ«ΆπŸ’–
πŸ“¦ where this page comes from