wait_on_bit_action(9)
π wait_on_bit_action (9) β like, the Kernel API Manual era π
okay bestie, so we're in the Kernel API Manual, section 9, and the star of the show is wait_on_bit_action. she waits. for a bit. to be cleared. that's the whole vibe. let's get into it β¨
β¨ NAME β¨
wait_on_bit_action β literally just waiting for a bit to be cleared π«Ά
πΈ SYNOPSIS πΈ
int wait_on_bit_action (unsigned long *word , int bit ,
wait_bit_action_f *action , unsigned mode );
π¦ ARGUMENTS π¦
wordβ the address that's holding the bit we're waiting on. it's giving home address for your fav bit πbitβ the actual bit at that address getting waited on. the main character of this whole operation πactionβ the function used to sleep, and ngl it may take special actions. it's not a regular sleep, it's a custom sleep πmodeβ the task state to sleep in. pick your nap vibe π΄
π DESCRIPTION π
so here's the tea: you wait for the given bit in an unsigned long or a bitmap (peep DECLARE_BITMAP) to be cleared. that's it, that's the job β¨
the clearing of the bit must be signalled with wake_up_bit, and lowkey it's often done as clear_and_wake_up_bit. no cap, this is required β don't skip the signal π¨
this is similar to wait_on_bit, but it calls action instead of schedule for the actual waiting. so instead of the default snooze, you get your custom sleepy function π
the returned value will be zero if the bit was cleared β in which case the call has ACQUIRE semantics π₯ β or it'll be the error code returned by action, if that call returned non-zero. so like, two possible outcomes, both iconic π
fr fr, remember: bit cleared = you get0and ACQUIRE semantics.actionreturned non-zero = you get that error code back. no guessing π
π SEE ALSO π
kernel file ./include/linux/wait_bit.h, plus the whole friend group:
wait_on_bit(9), wait_on_bit_io(9), wait_on_bit_timeout(9), wait_on_bit_lock(9), wait_on_bit_lock_io(9), wait_on_bit_lock_action(9), 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), wake_up_var_protected(9), wake_up_var_locked(9), clear_and_wake_up_bit(9), test_and_clear_wake_up_bit(9), atomic_dec_and_wake_up(9), store_release_wake_up(9)
and that's the page, bestie π«Ά this one lives in ./include/linux and the date on it is October 2026 β so yeah, she's from the future, slay βπ bye!! π
π¦ 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