kthread_func(9)
β¨ kthread_func(9) β¨
okay so bestie, welcome to another page of the Kernel API Manual π
this one's called kthread_func and honestly? it's a short one. a little snack. a tiny little morsel of kernel lore π let's get into it.
πΈ NAME πΈ
kthread_func β returns the function you specified when the kthread got created π«Ά like, "hey, what was this thread supposed to be running again?" and it just tells you. iconic behavior, no notes.
β¨ SYNOPSIS β¨
void * kthread_func (struct task_struct *task );
that's the whole thing. one function, one argument, one return value. minimalism ate π
π ARGUMENTS π
taskβ the kthread task in question π¦ literally just hand it the task you're curious about and it does its little lookup thing.
π DESCRIPTION π
Returns NULL if the task is not a kthread. that's it. that's the description π
so like... if you pass in something that isn't a kthread, you get NULL back. that's the documented behavior, that's the whole vibe check, and ngl it's giving "short but important" π
π SEE ALSO π
Kernel file ./kernel/kthread.c β and bestie, the whole kthread cinematic universe lives here, so let me introduce you to the entire friend group π:
kthread_should_stop(9)kthread_should_park(9)kthread_freezable_should_stop(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_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, thirty-one whole references. the kthread fam is large and they all show up to the group chat π₯
and that's the page, bestie!! short, sweet, extremely to the point π§ this cutie came out of ./kernel, dated October 2026, and lives at kthread_func(9) forever and ever π mwah, go read the rest of the kthread girlies, they're all linked above π
π¦ 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