From: Pavel Emelyanov <xemul@parallels.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Andrew Vagin <avagin@openvz.org>,
Serge Hallyn <serge.hallyn@canonical.com>,
Vasiliy Kulikov <segoon@openwall.com>
Subject: Re: [rfc 2/3] fs, proc: Introduce the Children: line in /proc/<pid>/status
Date: Fri, 02 Dec 2011 17:52:43 +0400 [thread overview]
Message-ID: <4ED8D82B.9080408@parallels.com> (raw)
In-Reply-To: <201112021344.40177.pedro@codesourcery.com>
On 12/02/2011 05:44 PM, Pedro Alves wrote:
> On Friday 02 December 2011 13:16:52, Pavel Emelyanov wrote:
>> On 12/02/2011 04:58 PM, Pedro Alves wrote:
>>> On Friday 02 December 2011 12:43:10, Pavel Emelyanov wrote:
>>>
>>>>>> Yes, I like /children file. other points seems to be pointed out by other
>>>>>> reviewers.
>>>>>
>>>>> Any reason this is a file instead of a directory like /proc/PID/task/ ?
>>>>>
>>>>> $ sudo ls /proc/8167/task/
>>>>> 8167 854 855 856 857 858 859
>>>>> $ sudo ls /proc/8167/task/855/
>>>>> attr clear_refs cpuset exe io loginuid mountinfo oom_adj pagemap sched smaps statm wchan
>>>>> auxv cmdline cwd fd latency maps mounts oom_score personality schedstat stack status
>>>>> cgroup comm environ fdinfo limits mem numa_maps oom_score_adj root sessionid stat syscall
>>>>>
>>>>> Much easier to follow the chain from the command line this way.
>>>>
>>>> What do you propose to put into these directories? Another directories named with
>>>> children pid-s?
>>>
>>> Yes, just like the task/ dir gives you directories named with the
>>> processes's thread ids. Opening /proc/PID/children/PID-CHILD1/ would get
>>> you the same as opening /proc/PID-CHILD1/. Just like
>>> opening /proc/PID/task/PID-CHILD1/ gets you (almost) the same as opening
>>> /proc/PID-CHILD1/.
>>
>> You cannot make the dentry named /proc/<pid1>/children/<pid2> be a hardlink on
>> the /proc/<pid2>. Thus you have to make arbitrary amount of inodes to point to
>> a single task. This brings unnecessary complexity and memory usage (by dentries
>> and proc inodes).
>
> How is this different from the _already existing_ /proc/<pid1>/task/ directory?
Those living in /proc/<pid1>/task do not live in /proc. At all. This explains
everything below.
> I can imagine that 98% of the code would be shared even? It's "just" a matter of
> listing thread group children (child/), instead of clone children (task/),
> isn't it?
>
> They are not symbolic links under task/. /proc/<pid1>/task/<pid2>/ does not
> have a task/ subdir, only /proc/<pid1>/ does, I guess to avoid the memory usage
> issue you raise.
>
>> I'd accept the symbolic links, but how would they look like? Like this:
>> # ls -l /proc/123/children
>> 234 -> ../../234
>> ?
>
> That'd work for me... but really, why not reuse tasks/'s code and
> behave the same?
Why wouldn't /proc/<pid>/children work for you? This is as simple as
# ls -l $(cat /proc/<pid>/children)
:)
Thanks,
Pavel
next prev parent reply other threads:[~2011-12-02 13:52 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 19:12 [rfc 0/3] A small bundle in a sake of checkpoint/restore Cyrill Gorcunov
2011-11-29 19:12 ` [rfc 1/3] fs, proc: Add start_data, end_data, start_brk members to /proc/$pid/stat Cyrill Gorcunov
2011-11-29 20:06 ` Kees Cook
2011-12-02 0:24 ` Alexey Dobriyan
2011-12-02 7:28 ` Cyrill Gorcunov
2011-12-02 19:23 ` Kees Cook
2011-12-02 19:28 ` Cyrill Gorcunov
2011-11-29 20:32 ` Serge Hallyn
2011-11-30 5:04 ` KAMEZAWA Hiroyuki
2011-11-29 19:12 ` [rfc 2/3] fs, proc: Introduce the Children: line in /proc/<pid>/status Cyrill Gorcunov
2011-11-30 5:00 ` KAMEZAWA Hiroyuki
2011-11-30 6:05 ` Cyrill Gorcunov
2011-12-01 9:54 ` Cyrill Gorcunov
2011-12-01 15:43 ` Tejun Heo
2011-12-01 15:53 ` Cyrill Gorcunov
2011-12-01 16:07 ` Tejun Heo
2011-12-01 21:29 ` Andrew Morton
2011-12-01 21:38 ` Cyrill Gorcunov
2011-12-02 0:40 ` KAMEZAWA Hiroyuki
2011-12-02 12:41 ` Pedro Alves
2011-12-02 12:43 ` Pavel Emelyanov
2011-12-02 12:45 ` Cyrill Gorcunov
2011-12-02 13:10 ` Pedro Alves
2011-12-02 13:40 ` Pedro Alves
2011-12-02 12:58 ` Pedro Alves
2011-12-02 13:16 ` Pavel Emelyanov
2011-12-02 13:44 ` Pedro Alves
2011-12-02 13:52 ` Pavel Emelyanov [this message]
2011-12-02 14:00 ` Pedro Alves
2011-12-02 14:17 ` Pavel Emelyanov
2011-12-02 14:25 ` Pedro Alves
2011-12-02 14:37 ` Pavel Emelyanov
2011-12-02 14:45 ` Pedro Alves
2011-11-29 19:12 ` [rfc 3/3] prctl: Add PR_SET_MM codes to tune up mm_struct entires Cyrill Gorcunov
2011-11-29 20:19 ` Kees Cook
2011-11-29 20:29 ` Cyrill Gorcunov
2011-11-29 20:37 ` Cyrill Gorcunov
2011-11-29 20:40 ` Kees Cook
2011-11-29 20:47 ` Cyrill Gorcunov
2011-11-30 17:37 ` Cyrill Gorcunov
2011-11-30 18:10 ` Kees Cook
2011-11-30 18:23 ` Cyrill Gorcunov
2011-11-30 21:06 ` Cyrill Gorcunov
2011-12-07 12:27 ` Cyrill Gorcunov
2011-12-07 22:43 ` Andrew Morton
2011-12-08 7:07 ` Cyrill Gorcunov
2011-12-08 7:15 ` Andrew Morton
2011-12-08 7:30 ` Cyrill Gorcunov
2011-11-29 20:37 ` Kees Cook
2011-11-29 20:49 ` Serge Hallyn
2011-11-29 20:55 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ED8D82B.9080408@parallels.com \
--to=xemul@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=avagin@openvz.org \
--cc=gorcunov@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pedro@codesourcery.com \
--cc=segoon@openwall.com \
--cc=serge.hallyn@canonical.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox