raw_atomic_...dnot_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_...dnot_relaxed β€” Kernel API Manual, bestie edition

okay so real talk, this page is from the Kernel API Manual and the whole filename got truncated into raw_atomic_...dnot_relaxed(9) which is giving "my name got cut off in the group chat preview" energy 😭 but it's fine, we know who she is. sit down, hydrate, let's talk about atomic bitwise AND NOT ✨


🌸 NAME 🌸

raw_atomic_fetch_andnot_relaxed β€” it does an atomic bitwise AND NOT, and the ordering is relaxed. that's the whole personality, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

int raw_atomic_fetch_andnot_relaxed (int i , atomic_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an int value. that's it, that's the integer. it's the thing getting flipped and ANDed in. πŸ’…
  • v β€” pointer to atomic_t. like, a pointer pointer, she points at the atomic. 🫢

✨ DESCRIPTION ✨

so what actually happens: v gets atomically updated to (v & ~i) β€” and the ordering is relaxed. atomically. all at once. nobody sees a half-done version, we don't do messy transitions here πŸ’…βœ¨

also she is safe to use in noinstr code πŸŽ€ but listen β€” prefer atomic_fetch_andnot_relaxed elsewhere. the raw one is for the special occasions, the non-raw one is the everyday slay. ok? ok. 😌


πŸ”₯ RETURN πŸ”₯

the original value of v β€” like, the value from before she changed it. she remembers where you came from, icon behaviour πŸ‘‘


🌈 SEE ALSO 🌈

buckle up bestie, this is the whole extended friend group 😭

the kernel file:

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

and now, deep breath, the family:


tiny disclaimer bestie: if you're in normal (non-noinstr) code, the move is atomic_fetch_andnot_relaxed. the raw_ version is the special-occasion one. love u, use her responsibly 🫢

okay that's the whole page!! mwah πŸ’– this lil slice lives in ./include/linux/atomic, dated October 2026, and that's a wrap, periodt βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from