Sujet : Re: The Ultimate Process List
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacyDate : 29. Apr 2024, 01:58:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v0mnrl$1arr4$1@dont-email.me>
References : 1 2 3
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Sun, 28 Apr 2024 23:14:54 -0000 (UTC), vallor wrote:
Here's what it looks like with 64 cores:
[lots of kernel threads shown]
Fun fact: in Linux, the parent process ID for kernel threads is not 1, but
2.
Traditionally, on *nix systems, the process with ID 1 is the ultimate root
of the process tree. That process can never terminate: if it does, the
system goes down.
However, on Linux, PID 1 is only the root of the userland process tree.
The kernel has its own internal housekeeping threads (on Linux, there is
very little difference between “processes” and “threads”), and rather than
send notifications about them to PID 1, they are in an entirely separate
tree, with its own ultimate root, PID 2, aka kthreadd.
If you look at the parent process IDs, you will see that every other
process/thread apart from these two have a nonzero parent. For these two,
the “parent” process ID is zero, indicating they have no parent.