raw_atomic_..._sub_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so welcome to the Kernel API Manual page for raw_atomic_..._sub_relaxed(9), bestie. The actual function is raw_atomic_long_fetch_sub_relaxed β€” it's giving atomic subtract with relaxed ordering, and yes, it's iconic.

✨ SYNOPSIS ✨

long raw_atomic_long_fetch_sub_relaxed (long i , atomic_long_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” a long value to subtract. that's the amount getting subtracted, periodt.
  • v β€” a pointer to atomic_long_t. this is the atomic long being updated, main character energy fr.

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: this function atomically updates v to (v - i), and the ordering is relaxed. no cap, that's the whole atomic glow-up.

It's safe to use in noinstr code. everywhere else, though, you should prefer atomic_long_fetch_sub_relaxed β€” that's the recommended bestie for non-noinstr situations. πŸ’…

🌸 RETURN 🌸

You get the original value of v back β€” like, the value from before the subtract happened. the pre-subtract era, if you will. 🫢

🌈 SEE ALSO 🌈

Kernel file: ./include/linux/atomic/atomic-long.h

πŸ’œ read + set girlies

πŸ”₯ add girlies

πŸ’€ sub girlies

πŸ“ inc girlies

🧚 dec girlies

πŸ‘‘ and + andnot girlies

⭐ or + xor girlies

πŸ¦‹ xchg + cmpxchg girlies

πŸŽ€ tests, negatives, and unless girlies


signed, sealed, and slayed by ./include/linux/atomic, dated October 2026, under the page tag raw_atomic_..._sub_relaxed(9) πŸ’…βœ¨

πŸ“¦ where this page comes from