From: Paul Mackerras <paulus@samba.org>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: alpha bug in signal handling
Date: Wed, 05 Dec 2001 20:55:26 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590698805625@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590698805617@msgid-missing>
David S. Miller writes:
> From: Richard Henderson <rth@redhat.com>
> Date: Tue, 4 Dec 2001 19:00:48 -0800
>
> On Tue, Dec 04, 2001 at 06:15:50PM -0800, David Mosberger wrote:
> > Oh, sorry, I was referring to teh *other* problem... ;-)
> >
> > What I meant is that the check for re-scheduling
> > (current->need_resched) and signal deliverify (current->sigpending)
> > needs to be done with interrupts turned off, and the interrupts need
> > to be left off until user space is reached. Otherwise, you could get
> > an interrupt which would wake up a higher priority task or post a
> > signal between the check and the return to user space.
> >
> > I didn't see this interrupt disabling in the Alpha version of entry.S,
> > but I have to admit my Alpha assembly is getting quite rusty.
>
> Oh, yes, I see. This should fix it.
>
> I don't understand why this is even necessary.
I think David (Mosberger, not Miller :) is right here, and in fact
this is also wrong on PPC at the moment. However, the worst case is
that the reschedule or signal delivery will get delayed until the next
interrupt on that cpu (max 1/HZ seconds). Since it is a pretty narrow
window for the race I think it would be hard to observe the effect of
the bug.
> What if the interrupt comes in on another processor. How does this
> return from trap behavior avoid that interrupt modifying the signal
> and/or scheduling state wrt. the current cpu's task?
If the interrupt comes in on another processor, then we call schedule()
on that processor and it does an IPI if it thinks that this processor
should reschedule.
The logic requires that we do the signal/schedule checks on exit to
userland. The scenario where they can get missed is where we are
returning to userland, and we get an interrupt just after we have done
the checks. Suppose the interrupt routine raises a signal or wakes up
a task. On the return from the interrupt routine it won't do the
signal/schedule checks because we are returning to the kernel
mainline. When we get back there it just completes the return to
userspace without doing the checks (since we have already done them).
Paul.
next prev parent reply other threads:[~2001-12-05 20:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-05 11:23 [Linux-ia64] Re: alpha bug in signal handling David S. Miller
2001-12-05 16:58 ` Richard Henderson
2001-12-05 20:17 ` David S. Miller
2001-12-05 20:55 ` Paul Mackerras [this message]
2001-12-05 21:15 ` Benjamin Herrenschmidt
2001-12-06 1:09 ` David S. Miller
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=marc-linux-ia64-105590698805625@msgid-missing \
--to=paulus@samba.org \
--cc=linux-ia64@vger.kernel.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