kthread_stop_put(9)
π kthread_stop_put(9) π
okay bestie, welcome to the Kernel API Manual, section 9, where we talk about kthread_stop_put. this one's a little two-for-one deal and honestly? kind of iconic of it.
β¨ NAME β¨
kthread_stop_put β stop a thread and put its task struct. two jobs, one function, main character energy fr fr.
π SYNOPSIS π
int kthread_stop_put (struct task_struct *k );
π¦ ARGUMENTS π¦
kβ a thread created bykthread_create. that's the one we're stopping, bestie. it has to be that kind of thread, no substitutions π«Ά
πΈ DESCRIPTION πΈ
so what this does is: it stops a thread created by kthread_create, and then it puts its task_struct. stop + put, like the name literally says. the way that the function name is just the description π slay.
β οΈ but listen β only use this when you're holding an extra task struct reference that you got by calling get_task_struct. it says "only," and it means only. no cap. if you didn't get that reference, this is not your function, bestie, put it down π
π SEE ALSO π
Kernel file ./kernel/kthread.c β the whole friend group lives there π§
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_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)
like, the entire kthread family reunion is right there π go say hi.
β the sign-off β
this whole page comes from ./kernel, dated October 2026, and it's kthread_stop_put(9) β that's the version tag, bestie, we're not making it up π
anyway. get that get_task_struct reference first, then come back. mwah! π
β¨π
π¦ 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