wait_for_completion(9)
β¨ wait_for_completion β bestie, let's wait for a task to finish β¨
okay so real quick, before anything else: you're reading the wait_for_completion(9) page from the Kernel API Manual π
(yes we're in kernel-land, yes it's giving main character energy, stay with me).
πΈ NAME πΈ
wait_for_completion β waits for completion of a task π
π¦ SYNOPSIS π¦
void wait_for_completion (struct completion *x );
π ARGUMENTS π
xβ holds the state of this particular completion. it's literally the little bookkeeper of your waiting arc, no cap πβ¨
π₯ DESCRIPTION π₯
So this one waits to be signaled for completion of a specific task. That's the whole vibe. You call it, you wait, somebody signals you, you're done. slay π«Ά
β οΈ But hear me loud and clear: it is NOT interruptible and there is no timeout. None. Zero. It's gonna wait however long it takes, and you're just gonna sit there. It's giving "held hostage by scheduling" energy ππ Not a single escape hatch. Plan accordingly.
Also pls go look at the similar routines (i.e. wait_for_completion_timeout) β those come with timeout and interrupt capability, which is lowkey the upgrade you might actually want. Also see complete. π
π SEE ALSO π
Kernel file ./kernel/sched/completion.c, plus the whole friend group:
complete(9)complete_all(9)wait_for_completion_timeout(9)wait_for_completion_io(9)wait_for_completion_io_timeout(9)wait_for_completion_interruptible(9)wait_for_completion_interruptible_timeout(9)wait_for_completion_killable(9)wait_for_completion_killable_timeout(9)try_wait_for_completion(9)completion_done(9)
okay that's the whole page, you ate that π β¨
sign-off szn: this little gem lives over at ./kernel/sched, stamped October 2026, and it's wait_for_completion(9) forever and always ππ¦πΈ go wait on something, bestie π«Ά
π¦ 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