atomic_long..._sub_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, this is atomic_long..._sub_release(9) from the Kernel API Manual πŸ’… and it's literally the page for atomic subtract with release ordering. Group-chat recap: you subtract, it's atomic, it's release-ordered, and you get the old value back. Slay.

✨ NAME ✨

atomic_long_fetch_sub_release β€” atomic subtract, but with release ordering. Periodt.

πŸ› οΈ SYNOPSIS πŸ› οΈ

long atomic_long_fetch_sub_release (long i , atomic_long_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” a long value; this is the amount you're subtracting.
  • v β€” pointer to atomic_long_t. Yes bestie, it's a pointer.

πŸ’– DESCRIPTION πŸ’–

It atomically updates v to (v - i) with release ordering. Like, the update is atomic and the ordering is release, no cap.

⚠️ Warning, bestie: it's unsafe to use in noinstr code. In there, use raw_atomic_long_fetch_sub_release instead.

πŸ” RETURN πŸ”

The original value of v β€” the pre-subtract value, iconic.

πŸ‘€ SEE ALSO πŸ‘€

They all live in the kernel file ./include/linux/atomic/atomic-instrumented.h, and the whole extended fam is here:

🌸 plain atomic_* crew

πŸ’« atomic64_* crew

🌟 atomic_long_* crew


xoxo, source/version: ./include/linux/atomic, date: October 2026 β€” and yes, atomic_long..._sub_release(9) is logging off πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from