kthread_cre...rker_on_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 kthread_create_worker_on_node(9) 🌸

okay bestie, so this is the kernel API manual page for kthread_cre...rker_on_node(9) β€” yes the header/footer truncate it like that, that's just how it vibes in the index, don't come for me πŸ’…. It's a section 9 kernel page, so buckle up buttercup.


✨ NAME ✨

kthread_create_worker_on_node β€” literally just: create a kthread worker. that's the whole thing. iconic brevity. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct kthread_worker * kthread_create_worker_on_node (unsigned int
flags , int node , const char namefmt[] , ... );

like, it hands you back a struct kthread_worker * β€” she's a pointer, she's allocated, she's ready 🫢


πŸ’– ARGUMENTS πŸ’–

  • flags β€” the flags that modify the default behavior of the worker. that's it, that's the whole story, no cap.
  • node β€” the task structure for the thread gets allocated on this node. so like, pick your NUMA node wisely bestie 🌈
  • namefmt β€” a printf-style name for the kthread worker (task). give her a cute name, she deserves it.
  • ... β€” variable arguments. the actual values that go into your namefmt. you know how printf works, i believe in you πŸ’œ

πŸ”₯ DESCRIPTION πŸ”₯

so what does it actually return?? glad you asked, this is important πŸ‘‘

  • On success β€” a pointer to the allocated worker. slay. ✨
  • ERR_PTR(-ENOMEM) β€” when the needed structures could not get allocated. she ran out of memory, it's giving budget cuts 😭
  • ERR_PTR(-EINTR) β€” when the caller was killed by a fatal signal. RIP to your thread, gone too soon πŸ’€
fr fr check that return value with IS_ERR() before you dereference anything, okay?? that's not in the page, that's just me caring about you 🫢 (the page says: pointer on success, ERR_PTR(-ENOMEM), ERR_PTR(-EINTR). that's the facts.)

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/kthread.c, plus literally the entire kthread friend group β€” she knows everybody:


okay that's the whole page, go forth and spawn threads responsibly πŸ§šπŸ’«

sign-off time: this little beauty lives in ./kernel, dated October 2026, and it's filed under kthread_cre...rker_on_node(9) β€” yeah the footer truncates it too, she's mysterious like that πŸ˜ŒπŸ’… bye bestie!! πŸ“

πŸ“¦ where this page comes from