[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5871495633F38949900D2BF2DC04883E55C374@G08CNEXMBPEKD02.g08.fujitsu.local>
Date: Thu, 3 Jul 2014 12:18:33 +0000
From: "chenhanxiao@...fujitsu.com" <chenhanxiao@...fujitsu.com>
To: "Eric W. Biederman (ebiederm@...ssion.com)" <ebiederm@...ssion.com>,
"Serge Hallyn (serge.hallyn@...ntu.com)" <serge.hallyn@...ntu.com>,
"Oleg Nesterov (oleg@...hat.com)" <oleg@...hat.com>,
"Richard Weinberger (richard@....at)" <richard@....at>,
"Pavel Emelyanov (xemul@...allels.com)" <xemul@...allels.com>,
"Vasily Kulikov (segoon@...nwall.com)" <segoon@...nwall.com>,
"Gotou, Yasunori" <y-goto@...fujitsu.com>,
"'Daniel P. Berrange (berrange@...hat.com)'" <berrange@...hat.com>
CC: "containers@...ts.linux-foundation.org"
<containers@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [RFC]Pid conversion between pid namespace
Hi,
We had some discussions on how to carry out
pid conversion between pid namespace via:
syscall[1] and procfs[2].
Pavel suggested that a syscall like
(ID, NS1, NS2) into (ID).
Serge suggested that a syscall
pid_t getnspid(pid_t query_pid, pid_t observer_pid).
Eric and Richard suggested a procfs solution is
more appropriate.
Oleg suggested that we should expand /proc/pid/status
to report this kind of information.
And Richard suggested adding a directory like
/proc/<pidX>/ns/proc/ which would contain everything
from /proc/<pidX inside the namespace>/.
As procfs provided a more user friendly interface,
how about expose all sets of tgid, pid, pgid, sid
by expanding /proc/PID/status in procfs?
And we could also expose ns hierarchy under /proc,
which could be another reference.
Ex:
init_pid_ns ns1 ns2
t1 2
t2 `- 3 1
t3 `- 4 `- 5 1
We could get in /proc/t3/status:
NSpid: 4 5 1
We knew that pid 1 in container is pid 4 in init ns.
And we could get ns hierarchy under /proc/ns_hierarchy like:
init_ns->ns1->ns2 (as the result of readlink)
->ns3
We knew that t3 in ns2, and its hierarchy.
How these ideas looks like?
Any comments would be appreciated.
Thanks,
- Chen
a) syscall
http://lwn.net/Articles/602987/
b) procfs
http://www.spinics.net/lists/kernel/msg1751688.html
Powered by blists - more mailing lists