linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Pavel Emelyanov <xemul@parallels.com>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Tejun Heo <tj@kernel.org>, Andrew Vagin <avagin@openvz.org>,
	Vasiliy Kulikov <segoon@openwall.com>
Subject: Re: [RFC] fs, proc: Introduce /proc/<pid>/task/<tid>/children entry v6
Date: Thu, 19 Jan 2012 16:55:29 +0100	[thread overview]
Message-ID: <20120119155529.GA14412@redhat.com> (raw)
In-Reply-To: <20120119141051.GA9652@redhat.com>

On 01/19, Oleg Nesterov wrote:
>
> On 01/18, Cyrill Gorcunov wrote:
> >
> > I suppose it might be something like below. I've updated comment and
> > quoted your comment there just I wont forget this next time I'll be
> > reading the source. Thanks!
>
> I believe the patrch is correct.
>
> But... Cyrill, I am wondering how much will you hate me if I make
> yet another attempt to delay this patch.

Cough... and another attempt...

> > +static int children_seq_open(struct inode *inode, struct file *file)
> > +{
> > +	struct proc_pid_children_iter *iter = NULL;
> > +	struct task_struct *task = NULL;
> > +	int ret = 0;
> > +
> > +	task = get_proc_task(inode);
> > +	if (!task) {
> > +		ret = -ENOENT;
> > +		goto err;
> > +	}
>
> For what??
>
> > +	if (!ret) {
> > +		struct seq_file *m = file->private_data;
> > +		m->private = iter;
> > +
> > +		iter->pid_start = get_pid(task_pid(task));
>
> This is what we need, right? So can't we remove this "task_struct *task"
> and simply do
>
> 		iter->pid_start = get_ppid(proc_pid(inode));
>
> ?
>
> And while this is absolutely cosmetic probably ->parent_pid is
> a bit better name, but this is up to you.

Thinking more... I am not sure, but do we really need
proc_pid_children_iter at all??

It is very possibly I missed something, but we can get both
parent_pid and pid_ns from inode, right? so can't we just remember
inode in seq->private?

Oleg.


  parent reply	other threads:[~2012-01-19 16:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 15:32 [RFC] fs, proc: Introduce /proc/<pid>/task/<tid>/children entry v6 Cyrill Gorcunov
2012-01-16 16:11 ` Oleg Nesterov
2012-01-16 16:20   ` Cyrill Gorcunov
2012-01-17 17:40     ` Oleg Nesterov
2012-01-17 17:57       ` Cyrill Gorcunov
2012-01-17 18:14         ` Oleg Nesterov
2012-01-17 18:30           ` Cyrill Gorcunov
2012-01-17 21:38 ` KOSAKI Motohiro
2012-01-18  9:43   ` Cyrill Gorcunov
2012-01-18 13:58   ` Oleg Nesterov
2012-01-18 14:21     ` Cyrill Gorcunov
2012-01-18 14:36       ` Oleg Nesterov
2012-01-18 18:23         ` Cyrill Gorcunov
2012-01-18 19:07           ` Cyrill Gorcunov
2012-01-19 14:10             ` Oleg Nesterov
2012-01-19 14:47               ` Cyrill Gorcunov
2012-01-19 15:55               ` Oleg Nesterov [this message]
2012-01-19 16:27                 ` Cyrill Gorcunov
2012-01-19 16:44                   ` Oleg Nesterov
2012-01-19 17:07                     ` 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=20120119155529.GA14412@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=gorcunov@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).