raw_atomic6...turn_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic64_sub_return_relaxed β€” from the Kernel API Manual, bestie ✨

Okay so real talk, this page is deep in the kernel-API manual and it is lowkey iconic for how much it does with so few words. Sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

raw_atomic64_sub_return_relaxed β€” atomic subtract with relaxed ordering πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 raw_atomic64_sub_return_relaxed (s64 i , atomic64_t *v );

πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value, and it's literally the thing you're subtracting ✨
  • v β€” pointer to atomic64_t πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So what it does is: atomically updates v to (v - i) with relaxed ordering. Like, the whole subtraction happens as one atomic operation, no cap 🧚

And the vibe check on the caveat: it's safe to use in noinstr code; prefer atomic64_sub_return_relaxed elsewhere. That's it, that's the rule πŸ’€

Bestie, take that noinstr note seriously β€” the manpage is telling you exactly where this one belongs, and everywhere else wants the other one πŸ™ˆ

🌈 RETURN 🌈

The updated value of v. She gives you the answer back, main character energy πŸ‘‘


⭐ SEE ALSO ⭐

The kernel file this lives in: ./include/linux/atomic/atomic-arch-fallback.h πŸ“

And because this family is huge, here is every single sibling β€” no skipping, we don't do that here πŸ’œ


And that's the whole page, bestie πŸ’– This one ships from ./include/linux/atomic, dated October 2026, straight out of the Kernel API Manual πŸŽ€ Go forth and subtract atomically, you absolute legend πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from