clear_and_wake_up_bit(9)
β¨ clear_and_wake_up_bit(9) β¨
okay so this is a page from the Kernel API Manual (section 9, kernel girlies rise π«Ά) and it's literally about clearing one (1) bit and then being like "hey everyone waiting on this, wake up bestie" π
πΈ NAME πΈ
clear_and_wake_up_bit β clear a bit and wake up anyone waiting on that bit
no cap, that's the whole job. it's giving "lights off, party's over, but politely" π
π¦ SYNOPSIS π¦
void clear_and_wake_up_bit (int bit , unsigned long *word );
void function, no return value, we love a low-stakes king π
π ARGUMENTS π
bitβ the bit of thewordbeing waited on. like, which little guy are we clearing. be specific.wordβ the address containing the bit being waited on. yes, anunsigned long *, the address itself, not the value. she needs the address fr fr.
π DESCRIPTION π
The designated bit is cleared and any tasks waiting in wait_on_bit or similar will be woken. so you clear it, and everyone who was napping in the wait queue gets the notification. main character move honestly.
This call has RELEASE semantics so that any changes to memory made before this call are guaranteed to be visible after the corresponding wait_on_bit completes. this part is important bestie β it's not just "wake up lol", it's "wake up AND everything I wrote down before I flipped the bit is actually readable now". the memory-ordering guarantee is the moment. iykyk β¨
honestly if you skip the RELEASE semantics part you're missing the whole point of the function, that's the actual slay here π₯
π SEE ALSO π
Kernel file ./include/linux/wait_bit.h β go read it, the whole friend group lives there π
the wait-y girlies:
wait_on_bit(9)wait_on_bit_io(9)wait_on_bit_timeout(9)wait_on_bit_action(9)wait_on_bit_lock(9)wait_on_bit_lock_io(9)wait_on_bit_lock_action(9)
the variable-waiting girlies:
wait_var_event(9)wait_var_event_io(9)wait_var_event_killable(9)wait_var_event_timeout(9)wait_var_event_interruptible(9)wait_var_event_any_lock(9)wait_var_event_spinlock(9)wait_var_event_mutex(9)
the waking-up girlies:
and the clear-and-wake cousins:
literally a whole friend group, obsessed ππ
and that's the page!! π this lil cutie lives in ./include/linux, dated October 2026, and that's the sign-off β mwah, go clear some bits responsibly bestie π§πβ
π¦ 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