kthread_park(9)
π€ kthread_park(9) β from the Kernel API Manual, bestie
okay so picture this: it's the kthread_park(9) page, it lives in the Kernel API Manual, and it's here to teach you how to put a kernel thread in timeout πβ¨
β¨ NAME β¨
kthread_park β park a thread created by kthread_create(). like, send it to its little parking spot and let it chill π
ΏοΈπ¦
πΈ SYNOPSIS πΈ
int kthread_park (struct task_struct *k );
π ARGUMENTS π
kβ the thread created bykthread_create. that's your girl. that's who we're parking π
π DESCRIPTION π
so what actually happens: it sets kthread_should_park for k to return true, wakes it up, and then waits for it to return. the way it's giving "I texted you, I woke you, now I'm waiting for a reply" ππ±
fun fact that's actually iconic: you can call this right after kthread_create instead of calling wake_up_process β the thread will park without calling threadfn. no function call, no problem, she just naps π΄β¨
returns 0 if the thread is parked π and -ENOSYS if the thread exited π and if it's called by the kthread itself, then just the park bit is set. that's it. that's the whole vibe π«Ά
π¦ SEE ALSO π¦
Kernel file ./kernel/kthread.c β and literally the whole kthread fam, no cap π
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_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_queue_delayed_work(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)
friend check: this is the<pink>./kernel</pink>kernel source tree, dated October 2026, and that's the whole page bestie β go park something πβ¨π
π¦ 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