kthread_park(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ kthread_park(9) β€” from the Kernel API Manual, bestie

okay so picture this: it's the kthread_park(9) page, it lives in the Kernel API Manual, and it's here to teach you how to put a kernel thread in timeout 😌✨


✨ NAME ✨

kthread_park β€” park a thread created by kthread_create(). like, send it to its little parking spot and let it chill πŸ…ΏοΈπŸ¦‹


🌸 SYNOPSIS 🌸

int kthread_park (struct task_struct *k );

πŸŽ€ ARGUMENTS πŸŽ€

  • k β€” the thread created by kthread_create. that's your girl. that's who we're parking πŸ’…

πŸ’– DESCRIPTION πŸ’–

so what actually happens: it sets kthread_should_park for k to return true, wakes it up, and then waits for it to return. the way it's giving "I texted you, I woke you, now I'm waiting for a reply" πŸ˜­πŸ“±

fun fact that's actually iconic: you can call this right after kthread_create instead of calling wake_up_process β€” the thread will park without calling threadfn. no function call, no problem, she just naps 😴✨

returns 0 if the thread is parked 🌈 and -ENOSYS if the thread exited πŸ’€ and if it's called by the kthread itself, then just the park bit is set. that's it. that's the whole vibe 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/kthread.c β€” and literally the whole kthread fam, no cap πŸ‘‘


friend check: this is the <pink>./kernel</pink> kernel source tree, dated October 2026, and that's the whole page bestie β€” go park something πŸ’œβœ¨πŸŽ€
πŸ“¦ where this page comes from