wait_event_...e_locked_irq(9)
π€ wait_event_interruptible_locked_irq(9) β the kernel API manual, but make it make sense
okay so bestie, welcome to the <pink>Kernel API Manual</pink> β¨ this one is about wait_event_interruptible_locked_irq, and yes the name is a whole paragraph, we're gonna get through it together π«Ά
πΈ NAME πΈ
wait_event_interruptible_locked_irq β sleep until a condition gets true π€β¨
π SYNOPSIS π
wait_event_interruptible_locked_irq (wq , condition );
π¦ ARGUMENTS π¦
wqβ the waitqueue to wait on. it's the line you're standing in, metaphorically πconditionβ a C expression for the event to wait for. like, the thing you're literally waiting around for π
π DESCRIPTION π
so the process gets put to sleep (TASK_INTERRUPTIBLE) until condition evaluates to true, or until a signal shows up and ruins the nap π and the condition gets checked every single time the waitqueue wq is woken up. every time. it's committed like that π
fr fr, it must be called with wq.lock being held. no exceptions, no "but Iβ", none of that π
so here's the tea on the spinlock β this spinlock is unlocked while sleeping, but the condition testing is done while the lock is held, and when this macro exits, the lock is held. so it leaves the lock exactly as it found it β main character energy that respects the dress code π
the lock is locked/unlocked using spin_lock_irq/spin_unlock_irq functions, and those must match the way they are locked/unlocked outside of this macro. consistency is the vibe check, ngl β
wake_up_locked has to be called after changing any variable that could change the result of the wait condition. like, if you moved the thing they're waiting for, you gotta tell them π
and the return values, bestie:
- the function will return
-ERESTARTSYSif it was interrupted by a signal π€ - and
0ifconditionevaluated to true π
π SEE ALSO π
Kernel file ./include/linux/wait.h β and honestly the whole waitqueue friend group, they all ate:
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_timeout(9)wait_event_idle_exclusive_timeout(9)wait_event_interruptible_locked(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)
this page lives in ./include/linux and it's dated October 2026 πΈ like, go read the header files bestie, they're right there πβ¨π
π¦ 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