flush_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

From the Kernel API Manual, bestie: flush_work β€” wait for a work to finish executing the last queueing instance. That's the whole assignment, and it ate. πŸ’…

✨ SYNOPSIS ✨

bool flush_work (struct work_struct *work );

πŸŽ€ ARGUMENTS πŸŽ€

  • work β€” the work to flush. Like, the actual struct work_struct * you're waiting on, bestie. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: flush_work waits until work has finished execution. On return, work is guaranteed to be idle if it hasn't been requeued since flush started. That conditional is literally the whole caveat, so don't ghost it. 😭

🌈 RETURN 🌈

It returns a bool, and it's giving very clear signals:

  • true β€” flush_work waited for the work to finish execution.
  • false β€” it was already idle.

No mystery, no cap. πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/workqueue.c is the mothership, and these are the whole friend group:


Sign-off, bestie: this page's source/version is ./kernel, and it's dated October 2026. It's the flush_work(9) page, and it's iconic. Stay hydrated, keep your work idle, and may your conditional guarantees stay valid. πŸ’–βœ¨

πŸ“¦ where this page comes from