wait_var_event(9)
π NAME π
okay so welcome to the Kernel API Manual page for wait_var_event(9), bestie β¨ This one is wait_var_event - wait for a variable to be updated and notified. slay.
π¦ SYNOPSIS π¦
wait_var_event (var , condition );
π ARGUMENTS π
varβ the address of variable being waited on. literally the address, no cap.conditionβ the condition to wait for. yes, that exact vibe.
π DESCRIPTION π
So the whole point: wait for a condition to be true, but only re-checking when a wake up is received for the given var. And var is an arbitrary kernel address β it does not need to be directly related to the given condition, though usually it is. iykyk π
The process will wait on a waitqueue selected by hash from a shared pool. It will only be woken on a wake_up for the given address. periodt.
π«Ά tiny but huge caveat: the condition should normally use smp_load_acquire or a similarly ordered access, so that any changes to memory made before the condition became true will be visible after the wait completes. no vibes-based memory ordering here, bestie π
β SEE ALSO β
Kernel file ./include/linux/wait_bit.h has the whole friend group:
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)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)
kisses bestie π this pageβs source/version info is ./include/linux, dated October 2026, and itβs the wait_var_event(9) manual page. 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