Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Parent PID for kthreads?
@ 2019-09-11 18:54 Martin Galvan
  0 siblings, 0 replies; only message in thread
From: Martin Galvan @ 2019-09-11 18:54 UTC (permalink / raw)
  To: kernelnewbies

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!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 18:54 Parent PID for kthreads? Martin Galvan

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox