__clear_bit_unlock(9)
π NAME π
__clear_bit_unlock β clears a bit in memory. Okay bestie, this is the __clear_bit_unlock(9) page from the Kernel API Manual, and it is lowkey giving βtiny function, serious barrier businessβ energy β¨
π SYNOPSIS π
void __clear_bit_unlock (long nr , volatile unsigned long *addr );
π§ ARGUMENTS π§
nrβ the bit to clear. Yep, thatβs the one getting cleared, no cap.addrβ the address to start counting from. Thatβs the starting point for the whole bit-finding mission, bestie π
β¨ DESCRIPTION β¨
So the vibe here is: this is a non-atomic operation, but it implies a release barrier before the memory operation. Like, itβs not out here doing the full atomic dance, but it is setting that release-barrier energy before the memory operation. Slay.
It can be used for an unlock if no other CPUs can concurrently modify other bits in the word. That βifβ is doing a LOT of heavy lifting, so please respect it β no other CPUs touching other bits in the same word at the same time, periodt. π«Ά
π SEE ALSO π
- Kernel file
./include/asm-generic/bitops/instrumented-lock.h clear_bit_unlock(9)test_and_set_bit_lock(9)xor_unlock_is_negative_byte(9)
xoxo from the ./include/asm-generic/bitops girlies, October 2026, with __clear_bit_unlock(9) signing off ππ
π¦ 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