RE: [PATCHv4] procfs: show hierarchy of pid namespace

From: Chen, Hanxiao
Date: Thu Oct 09 2014 - 05:01:33 EST




> -----Original Message-----
> From: Richard Weinberger [mailto:richard@xxxxxx]
> Sent: Wednesday, October 08, 2014 6:35 PM
> To: Chen, Hanxiao/é æé; containers@xxxxxxxxxxxxxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx
> 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@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.

Thanks,
- Chen