All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Davide Libenzi <davidel@xmailserver.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Roland McGrath <roland@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] will_become_orphaned_pgrp: we have threads
Date: Sun, 9 Dec 2007 17:21:16 +0300	[thread overview]
Message-ID: <20071209142116.GB131@tv-sign.ru> (raw)
In-Reply-To: <m11w9wpx03.fsf@ebiederm.dsl.xmission.com>

On 12/08, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
> 
> > p->exit_state != 0 doesn't mean this process is dead, it may have sub-threads.
> >
> > However, the new "p->exit_state && thread_group_empty(p)" check is not correct
> > either, this is just the temporary hack. Perhaps we can just remove this check,
> > but I don't understand orphaned process groups magic. At all. However, I think
> > exit_notify() is obviously and completely wrong wrt this helper.
> 
> The problem that orphaned processes groups address is what happens if
> an entire process group is stopped, and there is not a process that
> can wake them up.
> 
> The rule for an unprivileged process sending a signal to a process
> group is that it must be in the same session as the process group.
> 
> The rule for sending a signal to a process group is that the signal sender
> must be in the same session.
> 
> So we are testing for a process group that does not have a living
> member with a parent outside of the process that can send the process
> group a signal.

Ah, thanks a lot Eric, I am _starting_ to understand this.

> Oleg what do you see wrong with checking p->exit_state &&
> thread_group_empty(p)?   Since non-leader threads all self reap
> that seems to be a valid test for an dead thread group.

There is a window when exit_notify() drops tasklist and before release_task().
Suppose the last (non-leader) thread exits. This means that entire group exits,
but thread_group_empty() is not true.

Oleg.


  reply	other threads:[~2007-12-09 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-08 18:38 [PATCH 1/3] will_become_orphaned_pgrp: we have threads Oleg Nesterov
2007-12-08 23:50 ` Eric W. Biederman
2007-12-09 14:21   ` Oleg Nesterov [this message]
2007-12-09 15:45     ` Eric W. Biederman
2007-12-09 16:43       ` Oleg Nesterov
2007-12-09 23:56         ` Eric W. Biederman
2007-12-10 18:37           ` Oleg Nesterov
2007-12-11  1:36             ` Eric W. Biederman

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=20071209142116.GB131@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.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 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.