__clear_bit_unlock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 πŸ”—


xoxo from the ./include/asm-generic/bitops girlies, October 2026, with __clear_bit_unlock(9) signing off πŸ’‹πŸ’–

πŸ“¦ where this page comes from