raw_atomic6...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_dec_return_relaxed β€” from the Kernel API Manual ✨

okay bestie, so this page lives in the Kernel API Manual (section 9, kernel-space era 🫢) and it's about raw_atomic64_dec_return_relaxed. yes that's a long name. yes it's iconic. let's get into it πŸ’–


🌸 NAME 🌸

raw_atomic64_dec_return_relaxed β€” atomic decrement with relaxed ordering ✨

like, it takes one off a number, atomically, with relaxed vibes. no drama, no barriers, just math. πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 raw_atomic64_dec_return_relaxed (atomic64_t *v );

that's the whole signature, no cap. copy it exactly, spaces and all, she's sensitive πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic64_t. that's it. that's the whole arg list. she just needs a pointer to a 64-bit atomic and she'll do the rest 😌

⭐ DESCRIPTION ⭐

okay so the actual tea πŸ“: it atomically updates v to (v - 1) with relaxed ordering. atomically means nobody's gonna sneak in mid-decrement and mess up your number β€” it's giving main character energy, one clean operation, no interleaving πŸ’«

and because the ordering is relaxed, it's lowkey the "i'm not waiting around for anybody" version of the ordering options. memory ordering who? never met her. πŸ™ˆ

real talk though β€” this one is safe to use in noinstr code; prefer atomic64_dec_return_relaxed elsewhere. that's not me being shady, that's straight from the page, bestie. the raw_ family gets the noinstr pass, the plain one is your normal-day pick. pick accordingly πŸ‘‘

πŸ‘‘ RETURN πŸ‘‘

The updated value of v. πŸ’–

so like β€” not the old value, not a "did it work," just the shiny new number after the decrement. it looks like s64, it tastes like s64, it is s64. slay. ✨


🌈 SEE ALSO 🌈

okay so this is the part where she lists literally every cousin in the family. buckle up, this is a long guest list 🎟️

the raw_atomic_ originals ✨

raw_atomic_read(9), raw_atomic_read_acquire(9), raw_atomic_set(9), raw_atomic_set_release(9), raw_atomic_add(9), raw_atomic_add_return(9), raw_atomic_add_return_acquire(9), raw_atomic_add_return_release(9), raw_atomic_add_return_relaxed(9), raw_atomic_fetch_add(9), raw_atomic_fetch_add_acquire(9), raw_atomic_fetch_add_release(9), raw_atomic_fetch_add_relaxed(9), raw_atomic_sub(9), raw_atomic_sub_return(9), raw_atomic_sub_return_acquire(9), raw_atomic_sub_return_release(9), raw_atomic_sub_return_relaxed(9), raw_atomic_fetch_sub(9), raw_atomic_fetch_sub_acquire(9), raw_atomic_fetch_sub_release(9), raw_atomic_fetch_sub_relaxed(9)

the inc/dec girlies 🧚

raw_atomic_inc(9), raw_atomic_inc_return(9), raw_atomic_inc_return_acquire(9), raw_atomic_inc_return_release(9), raw_atomic_inc_return_relaxed(9), raw_atomic_fetch_inc(9), raw_atomic_fetch_inc_acquire(9), raw_atomic_fetch_inc_release(9), raw_atomic_fetch_inc_relaxed(9), raw_atomic_dec(9), raw_atomic_dec_return(9), raw_atomic_dec_return_acquire(9), raw_atomic_dec_return_release(9), raw_atomic_dec_return_relaxed(9), raw_atomic_fetch_dec(9), raw_atomic_fetch_dec_acquire(9), raw_atomic_fetch_dec_release(9), raw_atomic_fetch_dec_relaxed(9)

bitwise besties πŸ’œ

raw_atomic_and(9), raw_atomic_fetch_and(9), raw_atomic_fetch_and_acquire(9), raw_atomic_fetch_and_release(9), raw_atomic_fetch_and_relaxed(9), raw_atomic_andnot(9), raw_atomic_fetch_andnot(9), raw_atomic_fetch_andnot_acquire(9), raw_atomic_fetch_andnot_release(9), raw_atomic_fetch_andnot_relaxed(9), raw_atomic_or(9), raw_atomic_fetch_or(9), raw_atomic_fetch_or_acquire(9), raw_atomic_fetch_or_release(9), raw_atomic_fetch_or_relaxed(9), raw_atomic_xor(9), raw_atomic_fetch_xor(9), raw_atomic_fetch_xor_acquire(9), raw_atomic_fetch_xor_release(9), raw_atomic_fetch_xor_relaxed(9)

the swap & compare crowd πŸ”₯

raw_atomic_xchg(9), raw_atomic_xchg_acquire(9), raw_atomic_xchg_release(9), raw_atomic_xchg_relaxed(9), raw_atomic_cmpxchg(9), raw_atomic_cmpxchg_acquire(9), raw_atomic_cmpxchg_release(9), raw_atomic_cmpxchg_relaxed(9), raw_atomic_try_cmpxchg(9), raw_atomic_try_cmpxchg_acquire(9), raw_atomic_try_cmpxchg_release(9), raw_atomic_try_cmpxchg_relaxed(9)

tests, negatives & conditionals 🩷

raw_atomic_sub_and_test(9), raw_atomic_dec_and_test(9), raw_atomic_inc_and_test(9), raw_atomic_add_negative(9), raw_atomic_add_negative_acquire(9), raw_atomic_add_negative_release(9), raw_atomic_add_negative_relaxed(9), raw_atomic_fetch_add_unless(9), raw_atomic_add_unless(9), raw_atomic_inc_not_zero(9), raw_atomic_inc_unless_negative(9), raw_atomic_dec_unless_positive(9), raw_atomic_dec_if_positive(9)

now the 64-bit side, aka our actual household πŸ‘‘

raw_atomic64_read(9), raw_atomic64_read_acquire(9), raw_atomic64_set(9), raw_atomic64_set_release(9), raw_atomic64_add(9), raw_atomic64_add_return(9), raw_atomic64_add_return_acquire(9), raw_atomic64_add_return_release(9), raw_atomic64_add_return_relaxed(9), raw_atomic64_fetch_add(9), raw_atomic64_fetch_add_acquire(9), raw_atomic64_fetch_add_release(9), raw_atomic64_fetch_add_relaxed(9)

raw_atomic64_sub(9), raw_atomic64_sub_return(9), raw_atomic64_sub_return_acquire(9), raw_atomic64_sub_return_release(9), raw_atomic64_sub_return_relaxed(9), raw_atomic64_fetch_sub(9), raw_atomic64_fetch_sub_acquire(9), raw_atomic64_fetch_sub_release(9), raw_atomic64_fetch_sub_relaxed(9), raw_atomic64_inc(9), raw_atomic64_inc_return(9), raw_atomic64_inc_return_acquire(9), raw_atomic64_inc_return_release(9), raw_atomic64_inc_return_relaxed(9), raw_atomic64_fetch_inc(9), raw_atomic64_fetch_inc_acquire(9), raw_atomic64_fetch_inc_release(9), raw_atomic64_fetch_inc_relaxed(9)

raw_atomic64_dec(9), raw_atomic64_dec_return(9), raw_atomic64_dec_return_acquire(9), raw_atomic64_dec_return_release(9), raw_atomic64_fetch_dec(9), raw_atomic64_fetch_dec_acquire(9), raw_atomic64_fetch_dec_release(9), raw_atomic64_fetch_dec_relaxed(9), raw_atomic64_and(9), raw_atomic64_fetch_and(9), raw_atomic64_fetch_and_acquire(9), raw_atomic64_fetch_and_release(9), raw_atomic64_fetch_and_relaxed(9), raw_atomic64_andnot(9), raw_atomic64_fetch_andnot(9), raw_atomic64_fetch_andnot_acquire(9), raw_atomic64_fetch_andnot_release(9), raw_atomic64_fetch_andnot_relaxed(9)

raw_atomic64_or(9), raw_atomic64_fetch_or(9), raw_atomic64_fetch_or_acquire(9), raw_atomic64_fetch_or_release(9), raw_atomic64_fetch_or_relaxed(9), raw_atomic64_xor(9), raw_atomic64_fetch_xor(9), raw_atomic64_fetch_xor_acquire(9), raw_atomic64_fetch_xor_release(9), raw_atomic64_fetch_xor_relaxed(9), raw_atomic64_xchg(9), raw_atomic64_xchg_acquire(9), raw_atomic64_xchg_release(9), raw_atomic64_xchg_relaxed(9)

raw_atomic64_cmpxchg(9), raw_atomic64_cmpxchg_acquire(9), raw_atomic64_cmpxchg_release(9), raw_atomic64_cmpxchg_relaxed(9), raw_atomic64_try_cmpxchg(9), raw_atomic64_try_cmpxchg_acquire(9), raw_atomic64_try_cmpxchg_release(9), raw_atomic64_try_cmpxchg_relaxed(9), raw_atomic64_sub_and_test(9), raw_atomic64_dec_and_test(9), raw_atomic64_inc_and_test(9), raw_atomic64_add_negative(9), raw_atomic64_add_negative_acquire(9), raw_atomic64_add_negative_release(9), raw_atomic64_add_negative_relaxed(9), raw_atomic64_fetch_add_unless(9), raw_atomic64_add_unless(9), raw_atomic64_inc_not_zero(9), raw_atomic64_inc_unless_negative(9), raw_atomic64_dec_unless_positive(9), raw_atomic64_dec_if_positive(9)

and the source file herself, the address of the whole party 🏠

./include/linux/atomic/atomic-arch-fallback.h

iykyk πŸ’…


and that's the page, bestie!! 🫢 this lil love letter to atomics came out of ./include/linux/atomic, dated October 2026, and it's filed under raw_atomic64_dec_return_relaxed(9) in the Kernel API Manual β€” literal queen behavior, no notes πŸ‘‘βœ¨πŸ’–

πŸ“¦ where this page comes from