raw_atomic_...xchg_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_cmpxchg_release β€” bestie's guide to the atomic compare-and-swap (release flavor) πŸ¦‹

okay so this little cutie lives in the Kernel API Manual (that's the manual name, iykyk) and the page header up top is raw_atomic_...xchg_release(9) β€” but the actual function we're simping over is raw_atomic_long_cmpxchg_release. Yes, the naming is giving "abbreviated for the header". We move.


✨ NAME ✨

raw_atomic_long_cmpxchg_release β€” atomic compare and exchange with release ordering. it's literally the "if you're who I think you are, swap in" of atomics πŸ’–


🌸 SYNOPSIS 🌸

long raw_atomic_long_cmpxchg_release (atomic_long_t *v , long old , long new );

no cap, that's the whole signature. short king πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_long_t. the main character we're operating on 🫢
  • old β€” the long value to compare with. like, the vibe check we're expecting ✨
  • new β€” the long value to assign. the glow-up waiting in the wings πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea: if (v == old), it atomically updates v to new with release ordering. slay.

Otherwise? v is not modified and relaxed ordering is provided. no harm done, no drama, we just vibe on out πŸ’€

Safe to use in noinstr code β€” prefer atomic_long_cmpxchg_release elsewhere. so like, noinstr is the one place this raw version is the moment; everywhere else use the non-raw one, fr fr. it's giving "special occasion only" πŸ™ˆ

⭐ RETURN ⭐

The original value of v. periodt. 🎯


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/atomic/atomic-long.h β€” the whole friend group lives here 🏑

everyone in the family, no gatekeeping:

like I said. the whole group chat. πŸ’œ


kisses and good luck with your atomics, bestie πŸ§šπŸ’–

so yeah, that's the page β€” it ships from the source file ./include/linux/atomic, dated October 2026, and its version line is just the header name again: raw_atomic_...xchg_release(9). mwah πŸ’‹

πŸ“¦ where this page comes from