raw_atomic6...dnot_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_fetch_andnot_release β€” from the Kernel API Manual πŸŽ€

okay bestie, sit down, because today we're talking about raw_atomic64_fetch_andnot_release and honestly? she's a whole vibe. this is a page straight out of the Kernel API Manual, and it's giving "tiny function, huge consequences" energy. ✨


✨ NAME ✨

raw_atomic64_fetch_andnot_release β€” atomic bitwise AND NOT with release ordering. yes that's the whole name. no she will not be shortening it. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 raw_atomic64_fetch_andnot_release (s64 i , atomic64_t *v );

that's it. that's the whole call. two args, one s64 coming back at you. iconic. 🌸


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value. this is your bitmask bestie, the thing getting flipped and NOT-ed. 🫢
  • v β€” pointer to atomic64_t. this is the actual atomic you're messing with, and yes you're passing the pointer, not the value. πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

so the way this works: it atomically updates v to (v & ~i) with release ordering. no cap.

  • the & ~i part is literally "keep everything in v except the bits that are set in i" β€” bitwise AND NOT, exactly like it says on the tin. ⭐
  • the "atomically" part means nobody else sneaks a write in mid-operation. no race conditions, no drama. πŸ’€
  • the "release ordering" part is the memory-ordering flavor you're signing up for. that's the whole deal, that's the release girlie. 🌈
and the big one, bestie: this is safe to use in noinstr code. that's her whole personality. but if you're not in noinstr code, the manpage says to prefer atomic64_fetch_andnot_release instead. lowkey important, don't ignore it. 🧚

πŸ‘‘ RETURN πŸ‘‘

it hands you back the original value of v β€” like, the value before your fancy AND NOT happened. fetch-then-modify behavior, main character energy. πŸ’œ


🌟 SEE ALSO 🌟

first up, the source file, right where she lives:

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

and now… the entire found family. the whole raw atomic roster. i'm obsessed, there are so many of them, and every single one is here, exactly as written: πŸ¦‹


and that's the whole page, bestie. 🫢 she lives in ./include/linux/atomic, and this edition is dated October 2026 β€” go off, calendar icon. iykyk. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from