Parent PID for kthreads?

Martin Galvan omgalvan.86 at gmail.com
Wed Sep 11 14:54:50 EDT 2019


Hi all,

I'm looking for a way to determine the PID of the process on which
kthread_create is invoked to spawn a new kthread. The newly created
kthreads all show current->parent->pid == 2, which I understand
corresponds to kthreadd. current->tgid doesn't seem to be set to the
main process' PID either. Is there a way to determine this from within
the kthread? Thanks!



More information about the Kernelnewbies mailing list