raw_atomic_l...xchg_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ raw_atomic_l...xchg_release(9) β€” Kernel API Manual πŸ¦‹

okay so bestie, the actual function here is raw_atomic_long_xchg_release, and this is its Kernel API Manual moment. It’s the raw atomic-long exchange-with-release-ordering girlie, and she is lowkey iconic for noinstr code. πŸ’…


🌸 NAME 🌸

raw_atomic_long_xchg_release β€” atomic exchange with release ordering. That’s the whole vibe: swap in a new value, atomically, with release ordering doing its thing. ✨

✨ SYNOPSIS ✨

long raw_atomic_long_xchg_release (atomic_long_t *v , long new );

πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic_long_t. This is the atomic long getting the glow-up.
  • new β€” long value to assign. This is the fresh value moving in.

πŸ’– DESCRIPTION πŸ’–

Atomically updates v to new with release ordering. No cap, it’s an atomic exchange, and the release ordering is part of the package. 🫢

It’s safe to use in noinstr code; if you’re not in noinstr, prefer atomic_long_xchg_release elsewhere. That’s the β€œuse the regular one for normal contexts” note, bestie. πŸ’…

Quick vibe check: this page is about the raw_ version. The non-raw preference for ordinary code is atomic_long_xchg_release, exactly like the manpage says. πŸŽ€

🌈 RETURN 🌈

The original value of v. Yep, you get the before picture back β€” the value that was sitting there before the exchange. πŸ˜­πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

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

πŸ’– okay bye bestie β€” this page came from ./include/linux/atomic, dated October 2026, with the page tag raw_atomic_l...xchg_release(9). πŸ’–

πŸ“¦ where this page comes from