sync_change_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« sync_change_bit(9) πŸ’«

okay bestie, welcome to the kernel API manual β€” this one's sync_change_bit, and it's lowkey iconic ✨


🌸 NAME 🌸

sync_change_bit β€” flip a bit in memory, but make it atomic πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • nr β€” the bit you wanna change, bestie. that's the one getting toggled 🫢
  • addr β€” the address where we start counting from ✨

πŸ’– DESCRIPTION πŸ’–

so sync_change_bit is atomic and may not be reordered β€” no cap, that's the whole vibe check πŸ”₯

also, real talk: nr can be almost arbitrarily large, so don't come in here thinking this function only works on a single-word quantity, bc it literally does not 😭 it's giving main character energy across the whole range, periodt πŸ‘‘

ngl, "atomic and may not be reordered" is the kind of promise you do NOT wanna break β€” this is serious kernel business, so respect the guarantee πŸ’€

🌈 SEE ALSO 🌈

check the kernel file ./arch/x86/include/asm/sync_bitops.h for the whole squad:


and that's the page, bestie πŸ§šπŸ’œ sign-off time: this one lives under ./arch/x86/include/asm, dated October 2026, and yeah β€” it slayed πŸ“πŸŒ· fingers crossed you never have to debug a reordered bit flip, mwah πŸ’‹β­

πŸ“¦ where this page comes from