mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Michael Kerrisk <mtk-lkml@gmx.net>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] fix de_thread() vs do_coredump() deadlock
Date: Tue, 11 Apr 2006 02:10:07 -0700 (PDT)	[thread overview]
Message-ID: <20060411091007.484B52204D9@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Tuesday, 11 April 2006 15:47:53 +0400 <20060411114753.GA1088@oleg>

> Once again. Process starts exec, it has no pending signals. Execer thread sets
> SIGNAL_GROUP_EXEC, sends SIGKILL to other threads, and waits them to die.
> The first thread which dequeues SIGKILL will change SIGNAL_GROUP_EXEC to
> SIGNAL_GROUP_EXIT, thus aborting exec.

You are very right.  Sorry I did not manage to understand your objection
the first time around.  Sigh, trying to think on too little sleep again, I guess.

> Sorry for persistance if I really misunderstand this patch.

Thanks for the persistence.


What I'd really like to do here is get rid of these fake SIGKILLs.  We're
already waking the threads up directly in zap_other_threads.  We don't
really need to set SIGKILL pending.  By setting group_stop_count we can
make sure recalc_sigpending_tsk keeps signal_pending set, and every thread will
get into handle_group_stop.  The (SIGNAL_GROUP_EXIT | SIGNAL_GROUP_EXEC)
check there can just do_exit directly, instead of using the fatal signal path.
I'm inclined to get rid of zap_other_threads, since the part of it common
to both callers (de_thread and do_group_exit) will be just:

	for (t = next_thread(p); t != p; t = next_thread(t))
		if (!unlikely(t->exit_state))
			signal_wake_up(t, 1);

(The exit_signal business in the zap_other_threads loop is already dead
cruft, because ->exit_signal is always -1 in non-leader threads nowadays.)

If this makes sense to you, I'll rework my patch along these lines.  
But it seems like it will be easiest to do it after your other coredump and
de_thread changes are all resolved.

Also, I've realized that the same lost signal issue can occur for stop
signals.  There it's real hard to see what can be done other than trying to
stuff the signal back on the queue, which I've said is problematical.
I need to think about this more.


Thanks again,
Roland

  reply	other threads:[~2006-04-11  9:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 16:50 Oleg Nesterov
2006-04-10  1:36 ` Roland McGrath
2006-04-10 17:43   ` Oleg Nesterov
2006-04-11  7:27     ` Roland McGrath
2006-04-11 11:47       ` Oleg Nesterov
2006-04-11  9:10         ` Roland McGrath [this message]
2006-04-11 12:03       ` Oleg Nesterov
2006-04-10 21:40   ` Oleg Nesterov
2006-04-11  8:01     ` Roland McGrath
2006-04-11 13:13       ` Oleg Nesterov
2006-04-11  9:49         ` Roland McGrath

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=20060411091007.484B52204D9@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk-lkml@gmx.net \
    --cc=oleg@tv-sign.ru \
    --cc=torvalds@osdl.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

Powered by JetHome