mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC]Pid conversion between pid namespace
@ 2014-07-03 12:18 chenhanxiao
  2014-07-04  5:34 ` Yasunori Goto
  2014-07-09 10:34 ` chenhanxiao
  0 siblings, 2 replies; 15+ messages in thread
From: chenhanxiao @ 2014-07-03 12:18 UTC (permalink / raw)
  To: Eric W. Biederman (ebiederm@xmission.com),
	Serge Hallyn (serge.hallyn@ubuntu.com),
	Oleg Nesterov (oleg@redhat.com),
	Richard Weinberger (richard@nod.at),
	Pavel Emelyanov (xemul@parallels.com),
	Vasily Kulikov (segoon@openwall.com),
	Gotou, Yasunori,
	'Daniel P. Berrange (berrange@redhat.com)'
  Cc: containers, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1512 bytes --]

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

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-08-29  9:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03 12:18 [RFC]Pid conversion between pid namespace chenhanxiao
2014-07-04  5:34 ` Yasunori Goto
2014-07-09 10:34 ` chenhanxiao
2014-07-15  4:16   ` Serge Hallyn
2014-07-21 10:47     ` chenhanxiao
2014-07-25 17:34       ` Serge Hallyn
2014-07-28  8:14         ` Hu Tao
2014-07-28 13:24           ` Serge Hallyn
2014-07-25 10:01   ` chenhanxiao
2014-08-04 22:20     ` Serge Hallyn
2014-08-07 10:03       ` chenhanxiao
2014-08-07 16:11         ` Serge Hallyn
2014-08-08  9:30           ` chenhanxiao
2014-08-28 13:49             ` Serge E. Hallyn
2014-08-29  9:59               ` chenhanxiao

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®