raw_atomic64_fetch_and(9)
π raw_atomic64_fetch_and β Kernel API Manual
okay so bestie, welcome to section 9 of the Kernel API Manual β you're here for raw_atomic64_fetch_and(9) and honestly? she's a baddie. tiny page, huge energy. let's get into it π«Ά
πΈ NAME πΈ
raw_atomic64_fetch_and β atomic bitwise AND with full ordering
like, she does a bitwise AND and she does it atomically and she does it with full ordering. triple threat. main character energy fr π
β¨ SYNOPSIS β¨
s64 raw_atomic64_fetch_and (s64 i , atomic64_t *v );
that's it. that's the whole vibe check. two arguments, one s64 back. slay.
π ARGUMENTS π
iβ ans64value. yes, that's the whole description. she's a value. that's her job. it's giving minimalism β¨vβ pointer toatomic64_t. this is the girl getting ANDed. she's a pointer, so like, handle with care π
π¦ DESCRIPTION π¦
Atomically updates v to (v & i) with full ordering.
no cap β the whole operation is one atomic little moment. nobody sees the in-between. it's giving β¨seamlessβ¨. and the full ordering part? that means she's not being casual about memory ordering, she's being serious about it. full ordering, periodt π₯
Safe to use in noinstr code; prefer atomic64_fetch_and elsewhere.
so like β noinstr code is the super-strict zone, and she's allowed in there, which is iconic of her. but if you're not in noinstr code? use atomic64_fetch_and instead. she's telling you herself. listen to her π
π RETURN π
The original value of v.
not the new one, bestie β the original. the before picture πΈ. she hands you what v was prior to the AND, so you can go be nosy about it. iykyk π
π SEE ALSO π
okay this list is long long. like, genuinely. but every single one of these is here for a reason so we're doing all of them. no skipping. hydration and completeness π§
Kernel file ./include/linux/atomic/atomic-arch-fallback.h
π the 32-bit girlies β read & set
π add family
raw_atomic_add(9)raw_atomic_add_return(9)raw_atomic_add_return_acquire(9)raw_atomic_add_return_release(9)raw_atomic_add_return_relaxed(9)raw_atomic_fetch_add(9)raw_atomic_fetch_add_acquire(9)raw_atomic_fetch_add_release(9)raw_atomic_fetch_add_relaxed(9)
π sub family
raw_atomic_sub(9)raw_atomic_sub_return(9)raw_atomic_sub_return_acquire(9)raw_atomic_sub_return_release(9)raw_atomic_sub_return_relaxed(9)raw_atomic_fetch_sub(9)raw_atomic_fetch_sub_acquire(9)raw_atomic_fetch_sub_release(9)raw_atomic_fetch_sub_relaxed(9)
π inc family
raw_atomic_inc(9)raw_atomic_inc_return(9)raw_atomic_inc_return_acquire(9)raw_atomic_inc_return_release(9)raw_atomic_inc_return_relaxed(9)raw_atomic_fetch_inc(9)raw_atomic_fetch_inc_acquire(9)raw_atomic_fetch_inc_release(9)raw_atomic_fetch_inc_relaxed(9)
π dec family
raw_atomic_dec(9)raw_atomic_dec_return(9)raw_atomic_dec_return_acquire(9)raw_atomic_dec_return_release(9)raw_atomic_dec_return_relaxed(9)raw_atomic_fetch_dec(9)raw_atomic_fetch_dec_acquire(9)raw_atomic_fetch_dec_release(9)raw_atomic_fetch_dec_relaxed(9)
π and / andnot
raw_atomic_and(9)raw_atomic_fetch_and(9)raw_atomic_fetch_and_acquire(9)raw_atomic_fetch_and_release(9)raw_atomic_fetch_and_relaxed(9)raw_atomic_andnot(9)raw_atomic_fetch_andnot(9)raw_atomic_fetch_andnot_acquire(9)raw_atomic_fetch_andnot_release(9)raw_atomic_fetch_andnot_relaxed(9)
π or / xor
raw_atomic_or(9)raw_atomic_fetch_or(9)raw_atomic_fetch_or_acquire(9)raw_atomic_fetch_or_release(9)raw_atomic_fetch_or_relaxed(9)raw_atomic_xor(9)raw_atomic_fetch_xor(9)raw_atomic_fetch_xor_acquire(9)raw_atomic_fetch_xor_release(9)raw_atomic_fetch_xor_relaxed(9)
π exchange & compare-exchange
raw_atomic_xchg(9)raw_atomic_xchg_acquire(9)raw_atomic_xchg_release(9)raw_atomic_xchg_relaxed(9)raw_atomic_cmpxchg(9)raw_atomic_cmpxchg_acquire(9)raw_atomic_cmpxchg_release(9)raw_atomic_cmpxchg_relaxed(9)raw_atomic_try_cmpxchg(9)raw_atomic_try_cmpxchg_acquire(9)raw_atomic_try_cmpxchg_release(9)raw_atomic_try_cmpxchg_relaxed(9)
π the test-y ones
raw_atomic_sub_and_test(9)raw_atomic_dec_and_test(9)raw_atomic_inc_and_test(9)raw_atomic_add_negative(9)raw_atomic_add_negative_acquire(9)raw_atomic_add_negative_release(9)raw_atomic_add_negative_relaxed(9)raw_atomic_fetch_add_unless(9)raw_atomic_add_unless(9)raw_atomic_inc_not_zero(9)raw_atomic_inc_unless_negative(9)raw_atomic_dec_unless_positive(9)raw_atomic_dec_if_positive(9)
π§ and now the 64-bit girlies (that's our household)
π read & set
π add family
raw_atomic64_add(9)raw_atomic64_add_return(9)raw_atomic64_add_return_acquire(9)raw_atomic64_add_return_release(9)raw_atomic64_add_return_relaxed(9)raw_atomic64_fetch_add(9)raw_atomic64_fetch_add_acquire(9)raw_atomic64_fetch_add_release(9)raw_atomic64_fetch_add_relaxed(9)
π sub family
raw_atomic64_sub(9)raw_atomic64_sub_return(9)raw_atomic64_sub_return_acquire(9)raw_atomic64_sub_return_release(9)raw_atomic64_sub_return_relaxed(9)raw_atomic64_fetch_sub(9)raw_atomic64_fetch_sub_acquire(9)raw_atomic64_fetch_sub_release(9)raw_atomic64_fetch_sub_relaxed(9)
π inc family
raw_atomic64_inc(9)raw_atomic64_inc_return(9)raw_atomic64_inc_return_acquire(9)raw_atomic64_inc_return_release(9)raw_atomic64_inc_return_relaxed(9)raw_atomic64_fetch_inc(9)raw_atomic64_fetch_inc_acquire(9)raw_atomic64_fetch_inc_release(9)raw_atomic64_fetch_inc_relaxed(9)
π dec family
raw_atomic64_dec(9)raw_atomic64_dec_return(9)raw_atomic64_dec_return_acquire(9)raw_atomic64_dec_return_release(9)raw_atomic64_dec_return_relaxed(9)raw_atomic64_fetch_dec(9)raw_atomic64_fetch_dec_acquire(9)raw_atomic64_fetch_dec_release(9)raw_atomic64_fetch_dec_relaxed(9)
π and / andnot
raw_atomic64_and(9)raw_atomic64_fetch_and_acquire(9)raw_atomic64_fetch_and_release(9)raw_atomic64_fetch_and_relaxed(9)raw_atomic64_andnot(9)raw_atomic64_fetch_andnot(9)raw_atomic64_fetch_andnot_acquire(9)raw_atomic64_fetch_andnot_release(9)raw_atomic64_fetch_andnot_relaxed(9)
π or / xor
raw_atomic64_or(9)raw_atomic64_fetch_or(9)raw_atomic64_fetch_or_acquire(9)raw_atomic64_fetch_or_release(9)raw_atomic64_fetch_or_relaxed(9)raw_atomic64_xor(9)raw_atomic64_fetch_xor(9)raw_atomic64_fetch_xor_acquire(9)raw_atomic64_fetch_xor_release(9)raw_atomic64_fetch_xor_relaxed(9)
π exchange & compare-exchange
raw_atomic64_xchg(9)raw_atomic64_xchg_acquire(9)raw_atomic64_xchg_release(9)raw_atomic64_xchg_relaxed(9)raw_atomic64_cmpxchg(9)raw_atomic64_cmpxchg_acquire(9)raw_atomic64_cmpxchg_release(9)raw_atomic64_cmpxchg_relaxed(9)raw_atomic64_try_cmpxchg(9)raw_atomic64_try_cmpxchg_acquire(9)raw_atomic64_try_cmpxchg_release(9)raw_atomic64_try_cmpxchg_relaxed(9)
π the test-y ones
raw_atomic64_sub_and_test(9)raw_atomic64_dec_and_test(9)raw_atomic64_inc_and_test(9)raw_atomic64_add_negative(9)raw_atomic64_add_negative_acquire(9)raw_atomic64_add_negative_release(9)raw_atomic64_add_negative_relaxed(9)raw_atomic64_fetch_add_unless(9)raw_atomic64_add_unless(9)raw_atomic64_inc_not_zero(9)raw_atomic64_inc_unless_negative(9)raw_atomic64_dec_unless_positive(9)raw_atomic64_dec_if_positive(9)
bestie if you read that whole list you deserve a little treat π go drink some water, and remember: noinstr is the only place she needs to be the raw one π
okay that's the page!! she lives in ./include/linux/atomic, she's dated October 2026, and she's signing off as raw_atomic64_fetch_and(9) β mwah, go AND something atomically, you got this ππ
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms