kthread_queue_delayed_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 target kthread_worker (the one doing the actual work, main character energy πŸ‘‘)
  • dwork β€” the kthread_delayed_work you want to queue
  • delay β€” 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