raw_atomic_f..._and_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_fetch_and_relaxed β€” the Kernel API Manual files πŸ’…

okay bestie, so this page is from the Kernel API Manual (yes the whole manual, she's giving official documentation energy ✨) and it's about, like, the rawest little bit-twiddler in the atomic family. It's raw_atomic_fetch_and_relaxed(9), and no cap she's iconic.


πŸŽ€ NAME πŸŽ€

raw_atomic_fetch_and_relaxed β€” atomic bitwise AND with relaxed ordering πŸ’–

Lowkey the whole personality: she ANDs some bits, atomically, and she does not stress about ordering. Relaxed queen. Periodt.


🌸 SYNOPSIS 🌸

int raw_atomic_fetch_and_relaxed (int i , atomic_t *v );

That's the whole vibe. Two args, one int coming back out. Slay.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an int value. Yeah, literally just "int value". She's the mask, bestie. The thing you're ANDing with.
  • v β€” pointer to atomic_t. This is the main character. She's the atomic variable that's gonna get updated.

✨ DESCRIPTION ✨

Atomically updates v to (v & i) with relaxed ordering. That's it, that's the function. She goes in, she does the AND, she comes back out, nobody sees her, nothing tears. πŸ”₯

Lowkey the important part: she's safe to use in noinstr code. That's her whole niche, her whole brand. But β€” and I'm saying this with love β€” prefer atomic_fetch_and_relaxed elsewhere. This raw one is for the special cases, iykyk. πŸ™ˆ

fr fr, "elsewhere" means everywhere that isn't noinstr code. Don't be out here using the raw one just for the vibes. The regular one has your back everywhere else.

πŸ‘‘ RETURN πŸ‘‘

The original value of v β€” like, before the AND happened. She gives you the receipt of what she walked in with. πŸ’…

Classic fetch-and-whatever behaviour: you get the before picture, she keeps the after picture. Bestie tax.


🌈 SEE ALSO 🌈

First up, the actual source file, the origin story:

  • Kernel file ./include/linux/atomic/atomic-arch-fallback.h

And then… okay so. Deep breath. The rest of the atomic family showed up to the group chat. Every single one. Nobody was left out and honestly? Obsessed. 🫢


okay that's the whole roster 😭 every auntie, cousin and 64-bit twin. she said "family reunion" and she MEANT it. πŸ“


sign-off bestie πŸ’– β€” this page lives in ./include/linux/atomic, dated October 2026, and answers to the name raw_atomic_f..._and_relaxed(9) (yes her name got truncated in the header, she's fine, she's thriving, it's giving ellipsis main character energy πŸ’€βœ¨). go AND some bits responsibly. 🧚🫢

πŸ“¦ where this page comes from