atomic64_fetch_sub_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_fetch_sub_relaxed(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for atomic64_fetch_sub_relaxed(9), and honestly? she's a little workhorse and we stan her 🫢


🌸 NAME 🌸

atomic64_fetch_sub_relaxed β€” atomic subtract with relaxed ordering πŸ’– (yes, "relaxed" is literally in the name, she is chill like that)


✨ SYNOPSIS ✨

s64 atomic64_fetch_sub_relaxed (s64 i , atomic64_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” the s64 value you're subtracting. that's the number going bye-bye πŸ”₯
  • v β€” pointer to atomic64_t. that's the thing getting updated, main character energy πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she do? She atomically updates v to (v - i) with relaxed ordering. atomically, meaning nobody can catch her mid-subtract, no cap 🧚

⚠️ unsafe to use in noinstr code β€” like, actually don't. use raw_atomic64_fetch_sub_relaxed there instead. she said what she said πŸ’€

πŸ’œ RETURN πŸ’œ

The original value of v β€” i.e. the value before the subtract happened. she hands you the receipt, then changes the total 😭✨


🌈 SEE ALSO 🌈

okay this list is genuinely long, so grab a snack πŸ“ β€” the kernel file is ./include/linux/atomic/atomic-instrumented.h and here's the whole squad:


that's the whole page bestie, no skips, no cap πŸ’…βœ¨

and for the cute sign-off moment πŸŽ€ β€” this one came from ./include/linux/atomic, dated October 2026, and she answers to the name atomic64_fetch_sub_relaxed(9). go forth and subtract atomically, icon πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from