kthread_queue_delayed_work(9)
π kthread_queue_delayed_work β¨
okay bestie, so this is a page from the Kernel API Manual, and it's about kthread_queue_delayed_work β yes, the whole entire mouthful. it does exactly what the name says, no cap: it queues the associated kthread work after a delay π
πΈ NAME πΈ
kthread_queue_delayed_work β queue the associated kthread work after a delay.
like... that's the whole vibe. delayed work, queued, kthread. slay π
β¨ SYNOPSIS β¨
bool kthread_queue_delayed_work (struct kthread_worker *worker , struct
kthread_delayed_work *dwork , unsigned long delay );
that's it, that's the signature, three args and a bool coming back at you π«Ά
π¦ ARGUMENTS π¦
workerβ the targetkthread_worker(the one doing the actual work, main character energy π)dworkβ thekthread_delayed_workyou want to queuedelayβ how many jiffies to wait before queuing. yes, jiffies. not seconds, not ms, jiffies β
π DESCRIPTION π
so here's the tea π β if the work has not been pending, this starts a timer, and that timer will queue the work after the given delay.
and if delay is zero? oh she's impatient β it queues the work immediately. no waiting around, periodt π₯
π RETURN π
it gives you back false if the work has already been pending. what does that mean exactly? it means either the timer was running, or the work was queued. iykyk π
otherwise β true. true is the good one here π
π§ SEE ALSO π§
Kernel file ./kernel/kthread.c, plus the whole entire kthread friend group (ngl this is a lot of them, but we're listing every single one π):
kthread_should_stop(9), kthread_should_park(9), kthread_freezable_should_stop(9), kthread_func(9), kthread_data(9), kthread_probe_data(9), kthread_complete_and_exit(9), kthread_create_on_node(9), kthread_bind(9), kthread_create_on_cpu(9), kthread_unpark(9), kthread_park(9), kthread_stop(9), kthread_stop_put(9), kthread_affine_preferred(9), kthreads_update_housekeeping(9), kthread_worker_fn(9), kthread_create_worker_on_node(9), kthread_create_worker_on_cpu(9), kthread_queue_work(9), kthread_delayed_work_timer_fn(9), kthread_flush_work(9), kthread_mod_delayed_work(9), kthread_cancel_work_sync(9), kthread_cancel_delayed_work_sync(9), kthread_flush_worker(9), kthread_destroy_worker(9), kthread_use_mm(9), kthread_unuse_mm(9), kthread_associate_blkcg(9), kthread_blkcg(9)
that's the page!! π and a lil sign-off for the credits, because we always give credit: this one lives under ./kernel, from the Kernel API Manual, dated October 2026, and it's still called kthread_queue_delayed_work(9) β obsessed ππ¦β¨
π¦ 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