kthread_bind(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kthread_bind πŸ’…

okay so welcome to the Kernel API Manual page for kthread_bind β€” yes bestie, we're binding a just-created kthread to a cpu, and it's giving scheduler setup realness. πŸ’–

🌟 NAME 🌟

kthread_bind β€” bind a just-created kthread to a cpu. Periodt. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

void kthread_bind (struct task_struct *p , unsigned int cpu );

πŸ’– ARGUMENTS πŸ’–

  • p β€” thread created by kthread_create. That's the fresh little kthread in question. 🧚
  • cpu β€” cpu (might not be online, must be possible) for k to run on. Yep, it says k in the source; keep that energy. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

okay so this function is equivalent to set_cpus_allowed, except that cpu doesn't need to be online, and the thread must be stopped (i.e., just returned from kthread_create). That's the whole thing. No cap. ✨

⚠️ The thread must be stopped β€” like, it just came back from kthread_create. This isn't a suggestion, bestie. 🫢

🌈 SEE ALSO 🌈

Kernel file ./kernel/kthread.c β€” plus the whole kthread bestie roster:

That's the whole SEE ALSO guest list πŸ’œ


with love and scheduler-safe vibes: source/version ./kernel, dated October 2026. πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from