raw_atomic_f..._dec_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_f..._dec_relaxed(9) β€” Kernel API Manual 🌸

okay bestie, buckle up πŸ’– this is a page from the Kernel API Manual, and it's about one very specific little function: raw_atomic_fetch_dec_relaxed. yes, the name is a mouthful. no, we're not skipping any of it. periodt.


✨ NAME ✨

raw_atomic_fetch_dec_relaxed β€” atomic decrement with relaxed ordering πŸŽ€

✨ SYNOPSIS ✨

int raw_atomic_fetch_dec_relaxed (atomic_t *v );

✨ ARGUMENTS ✨

  • v β€” pointer to atomic_t 🫢 that's the thing we're about to nudge down by one.

✨ DESCRIPTION ✨

so the whole vibe is this: it atomically updates v to (v - 1) with relaxed ordering. atomically means nobody can catch it mid-decrement β€” it's giving main character energy, one clean unbroken operation ✨

also, it's safe to use in noinstr code. but like... prefer atomic_fetch_dec_relaxed elsewhere, okay? iykyk πŸ’…

✨ RETURN ✨

it hands you back the original value of v β€” like, the value from before the decrement. no cap, that's the whole return πŸ¦‹

✨ SEE ALSO ✨

first up, the file itself lives at <pink>./include/linux/atomic/atomic-arch-fallback.h</pink> β€” that's where the magic is, bestie 🌈

the 32-bit atomic_t girlies πŸ’œ

and the 64-bit atomic64 squad πŸ‘‘


okay that's literally everyone 🫢 this page came from <purple>./include/linux/atomic</purple>, and it's dated October 2026 β€” so, like, mark your calendars bestie πŸ—“οΈβœ¨ go decrement something responsibly, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from