From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>,
Serge Hallyn <serge.hallyn@ubuntu.com>,
Oleg Nesterov <oleg@redhat.com>,
Richard Weinberger <richard.weinberger@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: <containers@lists.linux-foundation.org>,
<linux-kernel@vger.kernel.org>,
David Howells <dhowells@redhat.com>,
Pavel Emelyanov <xemul@parallels.com>,
Vasiliy Kulikov <segooon@gmail.com>,
Mateusz Guzik <mguzik@redhat.com>
Subject: [PATCH v9 3/3] Documentation: add docs for /proc/pidns_hierarchy
Date: Mon, 1 Dec 2014 19:06:18 +0800 [thread overview]
Message-ID: <1417431978-24723-4-git-send-email-chenhanxiao@cn.fujitsu.com> (raw)
In-Reply-To: <1417431978-24723-1-git-send-email-chenhanxiao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
Documentation/namespaces/pidns-hierarchy.txt | 51 ++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 Documentation/namespaces/pidns-hierarchy.txt
diff --git a/Documentation/namespaces/pidns-hierarchy.txt b/Documentation/namespaces/pidns-hierarchy.txt
new file mode 100644
index 0000000..1820ae6d
--- /dev/null
+++ b/Documentation/namespaces/pidns-hierarchy.txt
@@ -0,0 +1,51 @@
+This document is about how to use pid namespace hierarchy procfs.
+
+We knew whether two pids living in the same pid namespace
+by /proc/PID/ns/pid, but their relationships
+between pids were unknown:
+we couldn't tell that one pid was another one's parent/siblings...
+But /proc/pidns_hierarchy could tell us the answer.
+
+/proc/pidns_hierarchy will show the hierarchy of pid namespace
+in the form of:
+
+<init_PID> <parent_of_init_PID> <relative PID level>
+
+init_PID: child reaper in a pid namespace
+parent_of_init_PID: init_PID's parent, child reaper too
+relative PID level: pid level relative to caller's ns,
+ started from '1'.
+
+Here is a chart to describe the relationship between
+some pids:
+
+ init_pid_ns level 0
+ |
+ 1
+ |
+┌────────────┐
+ns1 ns2 level 1
+| |
+1550 18060
+ |
+ |
+ ns3 level 2
+ |
+ 18102
+ |
+ ┌──────────┐
+ ns4 ns5 level 3
+ | |
+ 1534 1600
+
+It will be showed by /proc/pidns_hierarchy as below:
+
+#cat /proc/pidns_hierarchy
+18060 1 1
+18102 18060 2
+1534 18102 3
+1600 18102 3
+1550 1 1
+
+Note: numbers in column 1 are pid numbers in current ns,
+ they represent the pid '1' in different ns
--
1.9.3
next prev parent reply other threads:[~2014-12-01 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 11:06 [PATCH v9 0/3] ns, procfs: pid conversion between ns and showing pidns hierarchy Chen Hanxiao
2014-12-01 11:06 ` [PATCH v9 1/3] procfs: show hierarchy of pid namespace Chen Hanxiao
2014-12-04 12:23 ` Chen, Hanxiao
2014-12-01 11:06 ` [PATCH v9 2/3] /proc/PID/status: show all sets of pid according to ns Chen Hanxiao
2014-12-01 11:06 ` Chen Hanxiao [this message]
2014-12-23 10:20 [resend][PATCH v9 0/3] ns, procfs: pid conversion between ns and showing pidns hierarchy Chen Hanxiao
2014-12-23 10:20 ` [PATCH v9 3/3] Documentation: add docs for /proc/pidns_hierarchy Chen Hanxiao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417431978-24723-4-git-send-email-chenhanxiao@cn.fujitsu.com \
--to=chenhanxiao@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mguzik@redhat.com \
--cc=oleg@redhat.com \
--cc=richard.weinberger@gmail.com \
--cc=segooon@gmail.com \
--cc=serge.hallyn@ubuntu.com \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®