[PATCHv4] procfs: show hierarchy of pid namespace

Chen, Hanxiao chenhanxiao at cn.fujitsu.com
Thu Oct 9 09:01:21 UTC 2014

> -----Original Message-----
> From: Richard Weinberger [mailto:richard at nod.at]
> Sent: Wednesday, October 08, 2014 6:35 PM
> To: Chen, Hanxiao/陈 晗霄; containers at lists.linux-foundation.org;
> linux-kernel at vger.kernel.org
> Cc: Serge Hallyn; Eric W. Biederman; Oleg Nesterov; David Howells; Richard
> Weinberger; Pavel Emelyanov; Vasiliy Kulikov; Mateusz Guzik
> Subject: Re: [PATCHv4] procfs: show hierarchy of pid namespace
> Am 08.10.2014 11:56, schrieb Chen Hanxiao:
> > This patch will show the hierarchy of pid namespace
> > by /proc/pidns_hierarchy like:
> >
> > [root at localhost ~]#cat /proc/pidns_hierarchy
> > /proc/18060/ns/pid /proc/18102/ns/pid /proc/1534/ns/pid
> > /proc/18060/ns/pid /proc/18102/ns/pid /proc/1600/ns/pid
> > /proc/1550/ns/pid
> A proc file that prints paths of other proc files, srsly? ;)

Yes, sounds weird  though.

> I didn't follow the whole discussion but why is this not
> a directory containing symbolic links to other pid files in /proc/<PID>/ns/pid?

In the v1 version it’s a directory, and contained symlinks to /proc/<PID>/ns/pid
But we found that is not so easy to use:
a) dirs looks like a snapshot
refreshing it needs a lot of unnecessary codes.

b) dirs did not provide more info than proc file
	What we really need is the <PID>, and we could get it from
	proc file.
	When we read the file, we refresh it at that time.

- Chen

More information about the Containers mailing list