atomic64_fe...dnot_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_fetch_andnot_acquire(9)

okay so bestie, welcome to the Kernel API Manual πŸ’– this is the page for atomic64_fetch_andnot_acquire, and honestly? it's giving "quietly powerful, does one thing perfectly" main character energy. no cap, it's a little guy with a very long name and a very specific job.


✨ NAME ✨

atomic64_fetch_andnot_acquire β€” atomic bitwise AND NOT with acquire ordering πŸŽ€

like, it ANDs stuff. and NOTs stuff. atomically. with acquire ordering. all four at once, because it's an overachiever and we stan.


🌸 SYNOPSIS 🌸

s64 atomic64_fetch_andnot_acquire (s64 i , atomic64_t *v );

that's the whole handshake, bestie. two args, one s64 back. (and yes, the spacing is exactly like that in the header β€” don't come for me, i just report the vibes πŸ’€)


πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” a s64 value. this is the mask. the "NOT" part of the situation. she's the what to clear girlie.
  • v β€” pointer to atomic64_t. this is the target. the one getting updated. the main character, arguably.

πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea πŸ«– β€” it atomically updates v to (v & ~i) with acquire ordering.

lowkey that's it. that's the whole bit. ~i flips the mask, & clears those bits, and it all happens atomically so nobody can catch you mid-update. and the acquire ordering means the memory ordering comes along for the ride too β€” she's not just doing math, she's doing synchronization ✨

⚠️ unsafe to use in noinstr code β€” bestie i'm begging you, use raw_atomic64_fetch_andnot_acquire there instead. this one is instrumented, and instrumentation does NOT belong in noinstr land. that's a one-way ticket to weirdness 😭

⭐ RETURN ⭐

the original value of v. yes, original β€” she gives you the before picture, not the after. the way that it hands you the past while rewriting the future?? iconic. πŸ’…


🧚 SEE ALSO 🧚

the source of all this magic lives in the kernel file ./include/linux/atomic/atomic-instrumented.h πŸ“ and honestly the family tree is huge. buckle up, bestie, we're meeting the whole squad:

πŸ’œ the atomic_* crew

πŸ”₯ the atomic64_* crew (our own bloodline)

(psst β€” atomic64_fetch_andnot_acquire(9) isn't in that list because you're reading it right now. you're the page, bestie. πŸͺž)

🌈 the atomic_long_* crew


that's the whole family reunion, bestie. go clear some bits. responsibly. 🫢

πŸŽ€ signed, sealed, delivered from <pink>./include/linux/atomic</pink>, dated October 2026 β€” the Kernel API Manual said "that's a wrap" and honestly? she ate. πŸ’–βœ¨
πŸ“¦ where this page comes from