raw_atomic64..._dec_release(9)
π raw_atomic64..._dec_release(9)
okay so bestie, welcome to the Kernel API Manual πΈ β this page is literally titled raw_atomic64..._dec_release(9) and it's the whole rundown on the release-flavored atomic64 decrement. no cap, it's short, it's iconic, let's get into it π
β¨ NAME β¨
raw_atomic64_fetch_dec_release β atomic decrement with release ordering. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
s64 raw_atomic64_fetch_dec_release (atomic64_t *v );
(the spacing is exactly how the kernel wrote it, don't come for me π)
π ARGUMENTS π
vβ pointer toatomic64_t. it's giving "hand me the address of your counter please" π«Ά
π₯ DESCRIPTION π₯
so what does it actually do. it atomically updates v to (v - 1) with release ordering β¨
the way that works: you get the decrement and the release ordering in one neat little package, no extra steps, no drama π
and a lil note that matters: this one is safe to use innoinstrcode. but if you're not innoinstrcode, the manpage says to preferatomic64_fetch_dec_releaseelsewhere β like, that's the general-purpose one, this is the "I'm deep in the guts of the kernel" one. two different shoes for two different fits π
β RETURN β
it hands back the original value of v β aka the value from before the decrement, not after. the way that trips people up π so if v was 7, you get 7 back and v is now 6. periodt.
π SEE ALSO π
first up, the kernel file that lives at:
./include/linux/atomic/atomic-arch-fallback.h
then the whole extended family β like, the entire family tree. buckle up bestie, it's a long group chat π
the 32-bit raw_atomic_* crew:
raw_atomic_read,raw_atomic_read_acquire,raw_atomic_set,raw_atomic_set_releaseraw_atomic_add,raw_atomic_add_return,raw_atomic_add_return_acquire,raw_atomic_add_return_release,raw_atomic_add_return_relaxedraw_atomic_fetch_add,raw_atomic_fetch_add_acquire,raw_atomic_fetch_add_release,raw_atomic_fetch_add_relaxedraw_atomic_sub,raw_atomic_sub_return,raw_atomic_sub_return_acquire,raw_atomic_sub_return_release,raw_atomic_sub_return_relaxedraw_atomic_fetch_sub,raw_atomic_fetch_sub_acquire,raw_atomic_fetch_sub_release,raw_atomic_fetch_sub_relaxedraw_atomic_inc,raw_atomic_inc_return,raw_atomic_inc_return_acquire,raw_atomic_inc_return_release,raw_atomic_inc_return_relaxedraw_atomic_fetch_inc,raw_atomic_fetch_inc_acquire,raw_atomic_fetch_inc_release,raw_atomic_fetch_inc_relaxedraw_atomic_dec,raw_atomic_dec_return,raw_atomic_dec_return_acquire,raw_atomic_dec_return_release,raw_atomic_dec_return_relaxedraw_atomic_fetch_dec,raw_atomic_fetch_dec_acquire,raw_atomic_fetch_dec_release,raw_atomic_fetch_dec_relaxedraw_atomic_and,raw_atomic_fetch_and,raw_atomic_fetch_and_acquire,raw_atomic_fetch_and_release,raw_atomic_fetch_and_relaxedraw_atomic_andnot,raw_atomic_fetch_andnot,raw_atomic_fetch_andnot_acquire,raw_atomic_fetch_andnot_release,raw_atomic_fetch_andnot_relaxedraw_atomic_or,raw_atomic_fetch_or,raw_atomic_fetch_or_acquire,raw_atomic_fetch_or_release,raw_atomic_fetch_or_relaxedraw_atomic_xor,raw_atomic_fetch_xor,raw_atomic_fetch_xor_acquire,raw_atomic_fetch_xor_release,raw_atomic_fetch_xor_relaxedraw_atomic_xchg,raw_atomic_xchg_acquire,raw_atomic_xchg_release,raw_atomic_xchg_relaxedraw_atomic_cmpxchg,raw_atomic_cmpxchg_acquire,raw_atomic_cmpxchg_release,raw_atomic_cmpxchg_relaxedraw_atomic_try_cmpxchg,raw_atomic_try_cmpxchg_acquire,raw_atomic_try_cmpxchg_release,raw_atomic_try_cmpxchg_relaxedraw_atomic_sub_and_test,raw_atomic_dec_and_test,raw_atomic_inc_and_testraw_atomic_add_negative,raw_atomic_add_negative_acquire,raw_atomic_add_negative_release,raw_atomic_add_negative_relaxedraw_atomic_fetch_add_unless,raw_atomic_add_unless,raw_atomic_inc_not_zero,raw_atomic_inc_unless_negative,raw_atomic_dec_unless_positive,raw_atomic_dec_if_positive
and the 64-bit raw_atomic64_* besties (our main character lives here π):
raw_atomic64_read,raw_atomic64_read_acquire,raw_atomic64_set,raw_atomic64_set_releaseraw_atomic64_add,raw_atomic64_add_return,raw_atomic64_add_return_acquire,raw_atomic64_add_return_release,raw_atomic64_add_return_relaxedraw_atomic64_fetch_add,raw_atomic64_fetch_add_acquire,raw_atomic64_fetch_add_release,raw_atomic64_fetch_add_relaxedraw_atomic64_sub,raw_atomic64_sub_return,raw_atomic64_sub_return_acquire,raw_atomic64_sub_return_release,raw_atomic64_sub_return_relaxedraw_atomic64_fetch_sub,raw_atomic64_fetch_sub_acquire,raw_atomic64_fetch_sub_release,raw_atomic64_fetch_sub_relaxedraw_atomic64_inc,raw_atomic64_inc_return,raw_atomic64_inc_return_acquire,raw_atomic64_inc_return_release,raw_atomic64_inc_return_relaxedraw_atomic64_fetch_inc,raw_atomic64_fetch_inc_acquire,raw_atomic64_fetch_inc_release,raw_atomic64_fetch_inc_relaxedraw_atomic64_dec,raw_atomic64_dec_return,raw_atomic64_dec_return_acquire,raw_atomic64_dec_return_release,raw_atomic64_dec_return_relaxedraw_atomic64_fetch_dec,raw_atomic64_fetch_dec_acquire,raw_atomic64_fetch_dec_relaxedraw_atomic64_and,raw_atomic64_fetch_and,raw_atomic64_fetch_and_acquire,raw_atomic64_fetch_and_release,raw_atomic64_fetch_and_relaxedraw_atomic64_andnot,raw_atomic64_fetch_andnot,raw_atomic64_fetch_andnot_acquire,raw_atomic64_fetch_andnot_release,raw_atomic64_fetch_andnot_relaxedraw_atomic64_or,raw_atomic64_fetch_or,raw_atomic64_fetch_or_acquire,raw_atomic64_fetch_or_release,raw_atomic64_fetch_or_relaxedraw_atomic64_xor,raw_atomic64_fetch_xor,raw_atomic64_fetch_xor_acquire,raw_atomic64_fetch_xor_release,raw_atomic64_fetch_xor_relaxedraw_atomic64_xchg,raw_atomic64_xchg_acquire,raw_atomic64_xchg_release,raw_atomic64_xchg_relaxedraw_atomic64_cmpxchg,raw_atomic64_cmpxchg_acquire,raw_atomic64_cmpxchg_release,raw_atomic64_cmpxchg_relaxedraw_atomic64_try_cmpxchg,raw_atomic64_try_cmpxchg_acquire,raw_atomic64_try_cmpxchg_release,raw_atomic64_try_cmpxchg_relaxedraw_atomic64_sub_and_test,raw_atomic64_dec_and_test,raw_atomic64_inc_and_testraw_atomic64_add_negative,raw_atomic64_add_negative_acquire,raw_atomic64_add_negative_release,raw_atomic64_add_negative_relaxedraw_atomic64_fetch_add_unless,raw_atomic64_add_unless,raw_atomic64_inc_not_zero,raw_atomic64_inc_unless_negative,raw_atomic64_dec_unless_positive,raw_atomic64_dec_if_positive
π«Ά okay that's the whole page, go decrement something responsibly. this cutie came out of ./include/linux/atomic, October 2026 edition β ty for reading, mwah πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms