sync_clear_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sync_clear_bit β€” a.k.a. the Kernel API Manual moment

okay so bestie, welcome to sync_clear_bit(9), straight out of the Kernel API Manual ✨ this one's a tiny little function with a big main-character job: it clears a bit in memory. that's it. that's the vibe. let's get into it πŸŽ€


✨ NAME ✨

sync_clear_bit β€” Clears a bit in memory πŸ§ΉπŸ’«


🌸 SYNOPSIS 🌸

void sync_clear_bit (long nr , volatile unsigned long *addr );

like, look at her. so short. so iconic. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nr β€” the bit you're clearing, bestie 🎯 that's the one getting yeeted to zero.
  • addr β€” the address you start counting from πŸ—ΊοΈ like, where the counting begins, fr fr.

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea πŸ“: sync_clear_bit is atomic and may not be reordered. no cap, it's locked in like that. πŸ’…

BUT β€” and this is the important part, don't skip it β€” it does not contain a memory barrier 😭 so if you're out here using it for locking purposes, you should call smp_mb__before_atomic and/or smp_mb__after_atomic in order to ensure changes are visible on other processors. that's the whole deal, iykyk 🫢

lowkey do not forget the barrier calls if you're locking, bestie. the function will not do it for you and that's on periodt πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

the whole sync_bitops friend group, honestly. go say hi 🌈


okay that's the page!! mwah πŸ’‹ this lil cutie lives in ./arch/x86/include/asm, dated October 2026, and she's filed under sync_clear_bit(9) β€” go clear some bits for me, bestie, and slay responsibly πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from