___set_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ___set_bit(9) β€” from the Kernel API Manual, bestie πŸ’–

okay so. we're doing bitops today and honestly? this one's a lil gremlin. it's the non-atomic cousin and you need to know that going in. stay with me 🫢


✨ NAME ✨

___set_bit β€” set a bit in memory πŸ”₯

(three underscores. yes, THREE. count 'em. it matters, iykyk πŸ‘‘)


🌸 SYNOPSIS 🌸

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

that's the whole vibe. void return, nothing to check, no drama πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nr β€” the bit to set, bestie. which one? that one. 🎯
  • addr β€” the address to start counting from πŸ“

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea, and it's important tea β˜•

Unlike set_bit, this function is non-atomic and may be reordered. like. it's fast and it's giving "i trust you to know what you're doing" energy. no locks, no barriers, no safety net πŸ’€

and here's the part where you gotta pay attention: if it's called on the same region of memory simultaneously, the effect may be that only one operation succeeds. so like… if two of your threads roll up to the same memory at the same time, you might lose a bit. not "might error out", not "might warn you" β€” you just quietly lose the update πŸ™ˆ that's the whole hazard. so please, for the love of everything, don't be out here racing this thing unless you actually know it's safe 🌈

lowkey the non-atomic part is the entire personality of this function. don't forget it. don't "fix" it by pretending it's atomic. it is not. periodt πŸ’…

⭐ SEE ALSO ⭐

(notice the underscores, they're all matching the non-atomic family. one underscore, three underscores β€” they are NOT the same function, don't @ me 😭 go check each one fr fr)


that's the whole page, bestie, you ate it πŸ’– this lil icon came from ./tools/include/asm-generic/bi... and it's dated October 2026, so like… future knowledge, we love that for us πŸ¦‹ slay βœ¨πŸŽ€

πŸ“¦ where this page comes from