wait_event_idle_timeout(9)
π€ wait_event_idle_timeout(9) β the kernel API manual, but make it cute
okay so bestie, we're in the Kernel API Manual and today's main character is wait_event_idle_timeout π like, this is a 9-section manpage, iykyk. Buckle up.
β¨ NAME β¨
wait_event_idle_timeout β sleep without load until a condition becomes true or a timeout elapses π΄β°
Literally the whole vibe: you nap (but like, productively) until your thing happens or the clock runs out. No cap.
πΈ SYNOPSIS πΈ
wait_event_idle_timeout (wq_head , condition , timeout );
Three args, that's it, slay. π
π¦ ARGUMENTS π¦
wq_headβ the waitqueue to wait on π€ like, this is the line you're queued up in.conditionβ a C expression for the event to wait for β¨ the thing you're manifesting, fr fr.timeoutβ timeout, in jiffies β³ yes, jiffies, not seconds, don't come for me.
π DESCRIPTION π
The process is put to sleep (TASK_IDLE) until the condition evaluates to true π₯ note the TASK_IDLE β that's the "no load" part, so the scheduler isn't mad at you.
The condition is checked each time the waitqueue wq_head is woken up π every single wakeup = a fresh vibe check on your condition.
β οΈ ok important bestie:wake_uphas to be called after changing any variable that could change the result of the wait condition. Like, if you flip the variable and don't callwake_up, nobody knows. the sleeper just keeps sleeping. embarrassing. π
π RETURN π
Here's the tea on what you get back:
0if the condition evaluated to false after the timeout elapsed π (timeout hit, condition said no)1if the condition evaluated to true after the timeout elapsed π€¨ (timeout hit, but the condition did land true β iconic but late)- the remaining jiffies (at least
1) if the condition evaluated to true before the timeout elapsed π (early win! you get the leftover jiffies back, minimum1)
π§ SEE ALSO π§
All the siblings, and yes there are so many, family reunion energy π«Ά
Kernel file ./include/linux/wait.h β waitqueue_active(9), wq_has_single_sleeper(9), wq_has_sleeper(9), wake_up_pollfree(9), wait_event(9), wait_event_freezable(9), wait_event_timeout(9), wait_event_cmd(9), wait_event_interruptible(9), wait_event_interruptible_timeout(9), wait_event_hrtimeout(9), wait_event_interruptible_hrtimeout(9), wait_event_idle(9), wait_event_idle_exclusive(9), wait_event_idle_exclusive_timeout(9), wait_event_interruptible_locked(9), wait_event_interruptible_locked_irq(9), wait_event_interruptible_exclusive_locked(9), wait_event_interruptible_exclusive_locked_irq(9), wait_event_killable(9), wait_event_state(9), wait_event_killable_timeout(9), wait_event_lock_irq_cmd(9), wait_event_lock_irq(9), wait_event_interruptible_lock_irq_cmd(9), wait_event_interruptible_lock_irq(9), wait_event_interruptible_lock_irq_timeout(9)
π and that's the page π
shoutout to ./include/linux for housing this whole situation, this version is dated October 2026 β and the source/version line says ./include/linux + October 2026 + wait_event_idle_timeout(9) β so yeah, that's the sign-off, love u, 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