wait_var_event(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:


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