kthread_create_on_cpu(9)
π kthread_create_on_cpu(9) β from the Kernel API Manual, bestie
okay so this is kthread_create_on_cpu(9), straight out of the Kernel API Manual, and it's literally the glow-up helper for making a cpu bound kthread. like, binding a thread to one specific cpu? iconic. let's get into it π
β¨ NAME β¨
kthread_create_on_cpu β Create a cpu bound kthread πΈ
β¨ SYNOPSIS β¨
struct task_struct * kthread_create_on_cpu (int (*threadfn)(void *data)
, void *data , unsigned int cpu , const char *namefmt );
it returns a struct task_struct *, no cap π
β¨ ARGUMENTS β¨
threadfnβ the function that's gonna run, and it keeps running untilsignal_pending(current). that's the whole vibe, she goes until she's told to stop π«Άdataβ the data ptr you're handing off tothreadfn. her little care package πcpuβ the cpu where the thread should be bound. yes bestie, that one, specifically πnamefmtβ printf-style name for the thread. and here's the catch: format is restricted to"name.*u". the code fills in the cpu number itself. so don't get creative with it π
β¨ DESCRIPTION β¨
so literally what this does: this helper function creates and names a kernel thread. that's it. that's the whole thing. create β¨ and name β¨ and it's cpu bound because that's the whole point of the helper, see the cpu argument π₯
ngl that's the entire description, short and sweet, main character energy fr fr π
β¨ SEE ALSO β¨
kernel file ./kernel/kthread.c β and the whole kthread extended universe, besties π:
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_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)
okay that's the whole page, go read the source at ./kernel and remember: this beauty is dated October 2026, iykyk π¦π slay responsibly π§β¨
π¦ 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