From: Oleg Nesterov <oleg@redhat.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Roland McGrath <roland@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm 0/3] proc: task->signal can't be NULL
Date: Wed, 24 Mar 2010 18:49:07 +0100 [thread overview]
Message-ID: <20100324174907.GA20990@redhat.com> (raw)
In-Reply-To: <m1sk7qu5dl.fsf@fess.ebiederm.org>
On 03/23, Eric W. Biederman wrote:
>
> We need a value that can be computed in constant time, and is not correct
> except when the number of threads is actively changing.
Sure. I was thinking of something like
int get_nr_threads(struct task_struct *tsk)
{
int nr = atomic_read(&task->signal->live);
int reasonable_min = 1;
rcu_read_lock();
if (!thread_group_leader(tsk) && pid_alive(tsk) &&
tsk->group_leader->exit_state)
reasonable_min = 2;
rcu_read_unlock();
return max(nr, reasonable_min);
}
but as I said this doesn't look nice at all.
> > OK. Let's keep this counter as "int nr_thread".
> >
> > Besides, when I tried to re-implement get_nr_threads() using signal->live
> > I got the really ugly result ;)
>
> Sounds good.
OK, please see the "final" patch I am going to send...
Oleg.
prev parent reply other threads:[~2010-03-24 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 18:41 [PATCH -mm 0/3] proc: task->signal can't be NULL Oleg Nesterov
2010-03-23 2:18 ` Eric W. Biederman
2010-03-23 18:31 ` Oleg Nesterov
2010-03-23 20:53 ` Eric W. Biederman
2010-03-24 17:49 ` Oleg Nesterov [this message]
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=20100324174907.GA20990@redhat.com \
--to=oleg@redhat.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.