kthread_data(9)
π kthread_data(9) β a Kernel API Manual moment, section 9, bestie
Okay so real talk: this is the kthread_data page from the Kernel API Manual, and it's honestly one of the shortest glow-ups in the whole kthread cinematic universe. Tiny function, huge "I know my data" energy. Let's get into it π«Ά
β¨ NAME β¨
kthread_data β returns the data value that was specified when the kthread got created. That's it. That's the whole personality. π
πΈ SYNOPSIS πΈ
void * kthread_data (struct task_struct *task );
Literally just hand it a task and it hands you back a void *. No cap, that's the entire vibe check. β¨
π¦ ARGUMENTS π¦
taskβ the kthread task we're asking about π§. Like, this specific one, bestie, not some random other thread.
π DESCRIPTION π
So here's the deal: kthread_data returns the data value that was specified back when kthread task was created π. It's giving "remember when you were born? what were you holding?" energy and honestly I respect it.
β οΈ But listen β the caller is responsible for ensuring the validity oftaskwhen calling this function. That's on you, bestie. Not the kernel, not the compiler, not the universe. You. Validity check first, cute pointer deref second. Do not come crying to me whentaskis garbage ππ
β SEE ALSO β
The whole squad, fr fr β everything lives in the kernel file ./kernel/kthread.c π
kthread_should_stop(9)kthread_should_park(9)kthread_freezable_should_stop(9)kthread_func(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)
That's the whole page, bestie β short, sweet, and dangerously easy to misuse. Go forth and validate your pointers π
Mwah π β this lil' beauty ships out of ./kernel, dated October 2026, and it's kthread_data(9) till the end of time. Periodt. π
π¦ 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