[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5871495633F38949900D2BF2DC04883E5A0375@G08CNEXMBPEKD02.g08.fujitsu.local>
Date: Thu, 11 Sep 2014 09:48:51 +0000
From: "Chen, Hanxiao" <chenhanxiao@...fujitsu.com>
To: "Serge E. Hallyn" <serge@...lyn.com>
CC: "containers@...ts.linux-foundation.org"
<containers@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Richard Weinberger <richard.weinberger@...il.com>,
Serge Hallyn <serge.hallyn@...ntu.com>,
"Oleg Nesterov" <oleg@...hat.com>,
David Howells <dhowells@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: RE: [RFC PATCH 2/3] procfs: show hierarchy of pid namespace
> -----Original Message-----
> From: Serge E. Hallyn [mailto:serge@...lyn.com]
> Sent: Thursday, September 11, 2014 12:23 AM
> To: Chen, Hanxiao/陈 晗霄
> Cc: containers@...ts.linux-foundation.org; linux-kernel@...r.kernel.org;
> Richard Weinberger; Serge Hallyn; Oleg Nesterov; David Howells; Eric W. Biederman;
> Al Viro
> Subject: Re: [RFC PATCH 2/3] procfs: show hierarchy of pid namespace
>
> Quoting Chen Hanxiao (chenhanxiao@...fujitsu.com):
> > This patch will show the hierarchy of pid namespace
> > under /proc/pidns like:
> > /proc/pidns
> > ├── hierarchy
> > │ ├── pidns4026532399
> > │ │ ├── pidns -> /proc/2863/ns/pid
> > │ │ └── pidns4026532515
> > │ │ └── pidns -> /proc/10611/ns/pid
> > │ └── pidns4026532504
> > │ └── pidns -> /proc/4450/ns/pid
> > └── refresh
> >
> > a) hierarchy dir:
> > use to show hierarchy infomation using dir and symlinks.
> > dirs are named as pidns($inum)
> > a symlink is created under pidns($inum), and linked to
> > that pid namespace.
> >
> > b) refresh
> > trigger key.
> > We need to write sth to /proc/nspid/refresh,
> > then we could get hierarchy info
> > under /proc/pidns/hierarchy.
>
> Ouch. There may not be a better way, but it sure would be nice if
> we could simply have the list update in real-time.
>
> If we have to 'echo 1 > /proc/pidns/refresh' to update the fs tree under
> /proc/pidns/ to reflect new pidns activity, then why not just make this
> a text file? I suppose if it were a textfile you'd be encouraging ppl
> to 'cat pidlist | while read line; do grep line /proc/pidns; done',
> which would cause a refresh of that file for every grep?
Let's expose it in a text file
and refresh it when user open it.
style like:
level1 level2
/proc/2863/ns/pid /proc/10611/ns/pid
/proc/4450/ns/pid
It provided fairly the same information as dir trees.
And easy to use too.
>
> My concern with this approach is that it is unlike any other pseudo-fs
> that I know of, and people may simply expect the fs contents to be
> uptodate rather than a snapshot.
>
You're right, snapshot is not a good idea.
v2 will use a file /proc/pidns_hierarchy to show.
Thanks,
- Chen
Powered by blists - more mailing lists