LKML Archive on
help / color / mirror / Atom feed
From: Oleg Nesterov <>
To: Andrew Morton <>
Cc: Ingo Molnar <>, Pavel Emelyanov <>,
	Roland McGrath <>,
Subject: [PATCH 7/6] signals: handle_stop_signal: don't worry about SIGKILL
Date: Sun, 9 Mar 2008 20:23:29 +0300	[thread overview]
Message-ID: <> (raw)

handle_stop_signal() clears SIGNAL_STOP_DEQUEUED when sig == SIGKILL. Remove
this nasty special case. It was needed to prevent the race with group stop and
exit caused by thread-specific SIGKILL. Now that we use complete_signal() for
private signals too this is not needed, complete_signal() will notice SIGKILL
and abort the soon-to-begin group stop.

Except: the target thread is dead (has PF_EXITING). But in that case we should
not just clear SIGNAL_STOP_DEQUEUED and nothing more. We should either kill
the whole thread group, or silently ignore the signal.

I suspect we are not right wrt zombie leaders, but this is another issue which
and should be fixed separately. Note that this check can't abort the group stop
if it was already started/finished, this check only adds a subtle side effect
if we race with the thread which has already dequeued sig_kernel_stop() signal
and temporary released ->siglock.

Signed-off-by: Oleg Nesterov <>

--- 25/kernel/signal.c~7_HSS_NO_KILL	2008-03-09 17:48:28.000000000 +0300
+++ 25/kernel/signal.c	2008-03-09 20:21:02.000000000 +0300
@@ -643,12 +643,6 @@ static void handle_stop_signal(int sig, 
 			signal->flags &= ~SIGNAL_STOP_DEQUEUED;
-	} else if (sig == SIGKILL) {
-		/*
-		 * Make sure that any pending stop signal already dequeued
-		 * is undone by the wakeup for SIGKILL.
-		 */
-		signal->flags &= ~SIGNAL_STOP_DEQUEUED;

             reply	other threads:[~2008-03-09 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09 17:23 Oleg Nesterov [this message]
2008-03-11  2:11 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 7/6] signals: handle_stop_signal: don'\''t worry about SIGKILL' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).