wait_var_eve...nterruptible(9)
π€ wait_var_event_interruptible β kernel API manual β¨
okay so bestie, we're in the Linux kernel API manual, section 9, and the page is literally called wait_var_eve...nterruptible(9) (yes the title itself got truncated, it's giving "my name is too long for the header" π). Anyway. Sit down, grab a boba, we're learning to wait. π§
πΈ NAME πΈ
wait_var_event_interruptible β wait for a variable to be updated and notified π
β¨ SYNOPSIS β¨
wait_var_event_interruptible (var , condition );
π ARGUMENTS π
varβ the address of the variable being waited on πconditionβ the condition to wait for β
π DESCRIPTION π
So here's the vibe: you wait for a condition to be true or a signal to be received. That's it, that's the whole personality. π«Ά
But here's the cute little detail β it only re-checks the condition when a wake up is received for the given var. And var is an arbitrary kernel address which need not be directly related to the given condition, but usually is. iykyk. No cap, it can literally be any address, it's just usually the sensible one. π
This is similar to wait_var_event but β and this is the main character moment β it returns a value:
0if the condition became true π-ERESTARTSYSif a signal was received π
lowkey important: 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. Don't skip the ordering, bestie, that's how you get haunted bugs π
π₯ SEE ALSO π₯
Kernel file ./include/linux/wait_bit.h and the whole wait_bit extended universe π
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(9)wait_var_event_io(9)wait_var_event_killable(9)wait_var_event_timeout(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!! π it lives in ./include/linux, dated October 2026, and it's filed under wait_var_eve...nterruptible(9) β slay, go wake up some variables ππ¦
π¦ 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