mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Ingo Molnar <mingo@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: another subtle signals issue
Date: Wed, 12 Feb 2003 13:11:09 -0800	[thread overview]
Message-ID: <200302122111.h1CLB9D24412@magilla.sf.frob.com> (raw)
In-Reply-To: Linus Torvalds's message of  Wednesday, 12 February 2003 12:12:13 -0800 <Pine.LNX.4.44.0302121138570.8062-100000@penguin.transmeta.com>

> Btw, Roland, instead of your previous patch I would prefer something that 
> just makes "sig_ignored()" test the state of the signal better. Ie 
> something like the appended.

This should be fine (almost).  POSIX leaves it unspecified whether a
blocked, ignored signal is left pending or not.  The only thing it requires
is that setting a blocked signal to SIG_IGN clears any pending signal, and
sigaction already does that.

When I started hacking on this, I only looked at the old new code (i.e.
Ingo's thread group rewrite) not the old old code (i.e. 2.4).  Everything
that was not wrong I left as it was, and bailing early on SIG_IGN signals
without regard to blocking is what that code did when I started with it.
Bailing early can avoid going through the loop and possibly perturbing the
load balancing state, so I had assumed Ingo did it intentionally as an
optimization.

Your patch as is won't fix the ignored-SIG_DFL-interrupts bug in the MT
case.  That is, in __group_send_sig_info if P blocks the signal but some
other thread does not, then the that thread will get woken up and be
subject to all those problems.  So you need another check in or after the
loop, or to move the sig_ignored use after the loop.  After the loop or in
the loop exit condition, you can't get there if the signal is blocked on T,
so for that test you can omit the blocked and ptrace checks that your
sig_ignored does.

I don't see any other problems with doing this instead of just the checks
inserted my previous patch.


Enjoy,
Roland

  reply	other threads:[~2003-02-12 21:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0302111356550.1405-100000@penguin.transmeta.com>
2003-02-12  2:06 ` Roland McGrath
2003-02-12  2:45   ` Linus Torvalds
2003-02-12  3:05     ` Daniel Jacobowitz
2003-02-12  3:10       ` Linus Torvalds
2003-02-12  3:23         ` Roland McGrath
2003-02-12  3:38           ` Linus Torvalds
2003-02-12  3:13     ` Roland McGrath
2003-02-12  3:18       ` Linus Torvalds
2003-02-12  3:50         ` Roland McGrath
2003-02-12  4:21           ` Linus Torvalds
2003-02-12 20:12   ` Linus Torvalds
2003-02-12 21:11     ` Roland McGrath [this message]
2003-02-12 21:19       ` Linus Torvalds
2003-02-12 21:58         ` Roland McGrath
2003-02-12 21:42       ` Linus Torvalds
2003-02-12 22:04         ` 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=200302122111.h1CLB9D24412@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@transmeta.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

all inboxes | Powered by JetHome®