kthread_run_on_cpu(9)
π
kthread_run_on_cpu(9) π
okay so this is a page from the Kernel API Manual, and itβs lowkey iconic: kthread_run_on_cpu(9). Weβre talking about creating and waking a cpu bound thread, and the vibes are very βkernel thread main character energy.β β¨
π NAME π
kthread_run_on_cpu β create and wake a cpu bound thread. periodt. Thatβs the whole name-section mood, fr fr. π«Ά
πΈ SYNOPSIS πΈ
no cap, hereβs the exact signature β keep it cute and keep it literal:
struct task_struct * kthread_run_on_cpu (int (*threadfn)(void *data) ,
void *data , unsigned int cpu , const char *namefmt );
π ARGUMENTS π
threadfnβ the function to run untilsignal_pending(current). like, it keeps doing its thing until that signal situation shows up. βdataβ data ptr forthreadfn. simple, clean, a little pointer bestie. πcpuβ The cpu on which the thread should be bound, πnamefmtβ printf-style name for the thread. Format is restricted to"name.*u". Code fills in cpu number. iykyk β the format is not freestyle, bestie. π
π₯ DESCRIPTION π₯
Convenient wrapper for kthread_create_on_cpu followed by wake_up_process. thatβs it, thatβs the function, and it ate. π
Returns the kthread or ERR_PTR(-ENOMEM). so the return vibe check is: kthread on the happy path, ERR_PTR(-ENOMEM) when memory says no. π
bestie reminder: those literal names and tokens are not decorative β theyβre the actual API. no cap. π
π¦ SEE ALSO π¦
- Kernel file
./include/linux/kthread.hπ kthread_create(9)β¨kthread_run(9)πΈkthread_run_worker(9)πkthread_run_worker_on_cpu(9)π¦
okay bye bestie, mwah π β this pageβs source/version is ./include/linux, dated October 2026. πβ¨π«Ά
π¦ 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