atomic64_dec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_dec β€” atomic decrement with relaxed ordering

okay so this is a page from the Kernel API Manual, section 9 (atomic64_dec(9)), and bestie it's literally the tiniest little function but it does exactly one extremely important thing. let's get into it ✨


🌸 NAME

atomic64_dec β€” atomic decrement with relaxed ordering. that's it. that's the whole vibe. she subtracts one, atomically, no drama. πŸŽ€


πŸ¦‹ SYNOPSIS

void atomic64_dec (atomic64_t *v );

(yes the spacing is like that, don't come for her πŸ’€)


πŸ“ ARGUMENTS

  • v β€” pointer to atomic64_t. that's the lucky variable getting decremented. she's the main character here πŸ‘‘

πŸ’– DESCRIPTION

So basically: this atomically updates v to (v - 1) β€” with relaxed ordering. no cap, that's the entire job. one clean decrement, no tearing, no weird race-condition chaos, and the memory ordering is relaxed so she's not out here doing extra synchronization gymnastics she wasn't asked to do. lowkey iconic. πŸ’…

⚠️ Unsafe to use in noinstr code β€” and this is the part where you listen, bestie. if you're in noinstr code you literally cannot use this one. use raw_atomic64_dec there instead. that's the rule, periodt. 🫢

✨ RETURN

Nothing. she returns void. she gives you the decrement and nothing else, and honestly? respect. 😌


πŸ‘‘ SEE ALSO

first up, the source of truth β€” the kernel file ./include/linux/atomic/atomic-instrumented.h 🌈

and then the entire extended family, because this function has so many cousins and they all deserve a mention. grouped for your scrolling convenience, all in original order fr fr:

the 32-bit atomic_* girlies 🧚

the atomic64_* crew β€” ours πŸ”₯

the atomic_long_* extended fam πŸ¦‹


and that's the whole page, bestie! πŸŽ€ this one came from the kernel source dir ./include/linux/atomic and it's dated October 2026 β€” so like, future-flavored documentation, very demure, very mindful. go decrement something atomically. ily, bye! πŸ’œπŸ«Ά

πŸ“¦ where this page comes from