From: Andrew Morton <akpm@linux-foundation.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
Pavel Emelyanov <xemul@parallels.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Tejun Heo <tj@kernel.org>, Vasiliy Kulikov <segoon@openwall.com>,
Andrew Vagin <avagin@openvz.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs, proc: Introduce the /proc/<pid>/children entry v2
Date: Thu, 8 Dec 2011 13:54:30 -0800 [thread overview]
Message-ID: <20111208135430.00730308.akpm@linux-foundation.org> (raw)
In-Reply-To: <20111208212853.GO21678@moon>
On Fri, 9 Dec 2011 01:28:53 +0400
Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> On Thu, Dec 08, 2011 at 05:35:35PM +0100, Oleg Nesterov wrote:
> ...
> >
> > However, ->children list is not rcu-safe, this means that even
> > list_for_each() itself is not safe. Either you need tasklist or
> > we can probably make it rcu-safe...
> >
>
> Andrew, Oleg, does the below one look more less fine? Note the
> tasklist_lock is back and it worries me a bit since I imagine
> one could be endlessly reading some /proc/<pid>/children file
> increasing contention over this lock on the whole system
> (regardless the fact that it's take for read only).
It is a potential problem, from the lock-hold point of view and
also it can cause large scheduling latencies. What's involved in
making ->children an rcu-protected list?
> ---
> From: Cyrill Gorcunov <gorcunov@openvz.org>
> Subject: [PATCH] fs, proc: Introduce the /proc/<pid>/children entry v4
>
> There is no easy way to make a reverse parent->children chain
> from arbitrary <pid> (while parent pid is provided in "PPid"
> field of /proc/<pid>/status).
>
> So instead of walking over all pids in the system to figure out which
> children a task have -- we add explicit /proc/<pid>/children entry,
> because kernel already has this kind of information but it is not
> yet exported. This is a first level children, not the whole process
> tree, neither the process threads are identified with this interface.
The changelog doesn't explain why we want the patch, so there's no
reason to merge it! Something to do with c/r, yes?
If so, I guess the feature could/should be configurable. Probably with
a CONFIG_PROC_CHILDREN which is selected by CONFIG_CHECKPOINT_RESTORE.
Which is all getting a bit over the top, but I suppose we must do it.
Also, neither the changelog not the documentation mention the
loss-of-data problem which might occur if/when the lock is dropped.
The code now appears to be kinda-duplicating functionality which the
seq_file library provides. Shouldn't this have been
changelogged/commented? If it was, I wouldn't need to ask the next
question.
Why is it kinda-duplicating seq_file functionality? Can we strengthen
the seq_file code so this is unnecessary?
next prev parent reply other threads:[~2011-12-08 21:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 18:10 [PATCH] fs, proc: Introduce the /proc/<pid>/children entry v2 Cyrill Gorcunov
2011-12-06 22:33 ` Andrew Morton
2011-12-06 22:35 ` Cyrill Gorcunov
2011-12-07 9:41 ` Cyrill Gorcunov
2011-12-07 18:27 ` Tejun Heo
2011-12-07 18:43 ` Cyrill Gorcunov
2011-12-07 18:53 ` Oleg Nesterov
2011-12-07 19:03 ` Cyrill Gorcunov
2011-12-07 19:19 ` Cyrill Gorcunov
2011-12-07 20:34 ` Cyrill Gorcunov
2011-12-07 21:52 ` Cyrill Gorcunov
2011-12-08 16:35 ` Oleg Nesterov
2011-12-08 16:50 ` Cyrill Gorcunov
2011-12-08 21:28 ` Cyrill Gorcunov
2011-12-08 21:54 ` Andrew Morton [this message]
2011-12-08 22:21 ` Cyrill Gorcunov
2011-12-09 15:30 ` Oleg Nesterov
2011-12-09 15:49 ` Cyrill Gorcunov
2011-12-09 16:55 ` Oleg Nesterov
2011-12-09 17:11 ` 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=20111208135430.00730308.akpm@linux-foundation.org \
--to=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=oleg@redhat.com \
--cc=segoon@openwall.com \
--cc=serge.hallyn@canonical.com \
--cc=tj@kernel.org \
--cc=xemul@parallels.com \
/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