wait_for_completion(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:


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