sync_change_bit(9)
π« 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:
sync_set_bit(9)sync_clear_bit(9)sync_test_and_set_bit(9)sync_test_and_clear_bit(9)sync_test_and_change_bit(9)
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
- 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