queue_delayed_work_on(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

queue_delayed_work_on(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” today’s main character is queue_delayed_work_on, and she is lowkey iconic. ✨

πŸŽ€ NAME πŸŽ€

queue_delayed_work_on β€” queue work on specific CPU after delay. Periodt.

✨ SYNOPSIS ✨

No cap, here’s the signature:

bool queue_delayed_work_on (int cpu , struct workqueue_struct *wq ,
struct delayed_work *dwork , unsigned long delay );

🫢 ARGUMENTS 🫢

  • cpu β€” CPU number to execute work on.
  • wq β€” workqueue to use.
  • dwork β€” work to queue.
  • delay β€” number of jiffies to wait before queueing.

🌸 DESCRIPTION 🌸

So we queue the delayed_work to a specific CPU. For non-zero delays, the caller must ensure it is online and can’t go away. Lowkey this is the important part: if a caller fails to ensure this, they may get dwork->timer queued to an offlined CPU, and this will prevent queueing of dwork->work unless the offlined CPU becomes online again. 😭 That’s the whole vibe check.

πŸ”₯ RETURN πŸ”₯

false if work was already on a queue, true otherwise. If delay is zero and dwork is idle, it will be scheduled for immediate execution. Slay. πŸ’…

🌈 SEE ALSO 🌈

Kernel file ./kernel/workqueue.c is where it all lives, and the workqueue friend group is giving family reunion, iykyk:


okay that’s the whole page, bestie 🫢 β€” source/version is ./kernel, dated October 2026. Go queue something cute. πŸ’–

πŸ“¦ where this page comes from