atomic_fetch_dec_relaxed(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

โœจ atomic_fetch_dec_relaxed โœจ

okay so welcome to the Kernel API Manual, section 9 โ€” yes bestie, this is a real manual page, and it's from the Kernel API Manual, and today's main character is atomic_fetch_dec_relaxed(9) ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

atomic_fetch_dec_relaxed โ€” atomic decrement with relaxed ordering ๐ŸŽ€


โœจ SYNOPSIS โœจ

int atomic_fetch_dec_relaxed (atomic_t *v );

๐Ÿฆ‹ ARGUMENTS ๐Ÿฆ‹

  • v โ€” pointer to atomic_t. that's it. that's the whole argument. she's a pointer to an atomic_t and she knows it ๐Ÿ‘‘

๐Ÿ’– DESCRIPTION ๐Ÿ’–

ok so listen. atomic_fetch_dec_relaxed atomically updates v to (v - 1) with relaxed ordering. it just... does the decrement, all at once, no half-steps, no drama, no race conditions crashing your vibe. the ordering is relaxed, meaning she's not out here putting up memory fences everywhere โ€” lowkey chill about ordering, highkey atomic about the math ๐Ÿงฎโœจ

โš ๏ธ unsafe to use in noinstr code โ€” use raw_atomic_fetch_dec_relaxed there instead. like, do not bring this one to the noinstr party, she is not on the list ๐Ÿ™ˆ fr fr

๐Ÿ‘‘ RETURN ๐Ÿ‘‘

she gives you back the original value of v โ€” the value from before the decrement, bestie. iconic behavior honestly ๐Ÿ’€


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

first up, the source of truth, the lore drop: kernel file ./include/linux/atomic/atomic-instrumented.h ๐Ÿซถ

ok now the extended family. it's a big family. like a really big family. grab a snack ๐Ÿ“

๐Ÿ’œ the atomic_* girlies

๐ŸŽ€ the atomic64_* crew

๐Ÿงš the atomic_long_* squad


and that's the whole page bestie, no skips, no cuts, we ate and left no crumbs ๐Ÿฝ๏ธโœจ

sign-off time ๐Ÿซถ this one came from ./include/linux/atomic, dated October 2026, and it's filed under atomic_fetch_dec_relaxed(9) โ€” mwah, bye ๐Ÿ’‹๐ŸŽ€

๐Ÿ“ฆ where this page comes from