From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Arjan van de Ven <arjan@infradead.org>,
Alan Cox <alan@redhat.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq()
Date: Sun, 04 Jun 2006 21:04:34 -0400 [thread overview]
Message-ID: <1149469474.29652.46.camel@localhost.localdomain> (raw)
In-Reply-To: <20060604214448.GA6602@elte.hu>
On Sun, 2006-06-04 at 23:44 +0200, Ingo Molnar wrote:
> * Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Sun, 2006-06-04 at 22:26 +0100, Alan Cox wrote:
> > > Ar Sul, 2006-06-04 am 12:22 -0400, ysgrifennodd Steven Rostedt:
> > > > But can't this machine still cause an interrupt storm if the interrupt
> > > > comes on a wrong line, and we don't call the handler for the interrupt
> > > > source because we are now honoring disable_irq?
> > >
> > > Yes - that is why we can't honour disable_irq in this case but have to
> > > hope 8)
> > >
> >
> > Hmm, maybe this can be solved with something like what the -rt patch
> > does with threading interrupts and the interrupt mask. I'm not
> > suggesting threading interrupts. But, if the misrouted irq comes
> > across a disabled_irq, that it sets some flag, and doesn't unmask the
> > interrupt when finished. Have enable_irq see the flag and have it
> > unmask the interrupt if it is safe to do so.
> >
> > This all may be pretty hacky, but it's trying to fix code for hardware
> > that is already hacky. Note, that this would need to be compiled in
> > as on option to actually implement any of this crap.
>
> no ... lets not mix threaded IRQs in here. The model of executing an
> interrupt handler has nothing to do with the irq flow itself. Whatever
> can be done with a threaded handler can be done via atomic ISRs too.
I wasn't suggesting threading the handler. But to use the technique
that threaded handlers use. That is to postpone the unmasking of the
interrupt until a later time. Sorry to not make that point clearer.
>
> pretty much the only correct solution seems to be to go with Arjan's
> suggestion and make the 'disabled' property per-action, instead of the
> current per-desc thing. (obviously the physical act of masking an
> interrupt line is fundamentally per-desc, but the act of running an
> action "behind the back" of a masked line is still OK.) Unfortunately
> this would also mean the manual conversion of 300+ places that use
> disable_irq()/enable_irq() currently ... so it's no small work. (and the
> hardest part of the work is to find a safe method to convert them
> without introducing bugs)
I don't think that solves the problem. Even if you disable at the
handler level, and that handler happened to cause an interrupt that is
level sensitive and needs the driver to disarm it, the problem returns.
So if disable_irq_handler disabled the handler and the interrupt, but
then this interrupt happened to come in on another line what happens?
If you decide to skip this handler because it was labeled "don't touch
me", we will again get the interrupt storm because as soon as you return
from the interrupt handler from the misrouted irq, it will be triggered
again!
So what I'm suggesting, is that we flag the case that a handler (or the
irq in general) is disabled when a misrouted irq is performed. If the
irq was not covered by an interrupt handler, and there was a skipped
handler due to disable_irq, we then don't unmask the irq on return from
the interrupt but instead flag it. Now when the irq is reenabled, the
flag is checked and if it wasn't handled already, we call the handler
then.
Actually this means that we really don't need the use of the
disable_irq_handler. We keep all the code with the interrupt part, and
we can do the accounting there.
Understand where I'm getting at? By skipping a handler you risk having
an interrupt storm anyway. But my idea is to have accounting to handle
disabled_irqs and only unmask the irq if it was handled and we didn't
skip any handlers due to disable_irq. That way we can push the work
into enable_irq and avoid modifying 300+ calls to disable_irq not to
mention enable_irq as well.
I'd do a patch to show what I mean, but you will have to wait a week and
a half. I'll be traveling again, and wont be able to work on it until
then (unless I can squeeze some time tomorrow ;)
-- Steve
next prev parent reply other threads:[~2006-06-05 1:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 20:02 [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq() Ingo Molnar
2006-05-31 20:31 ` Arjan van de Ven
2006-05-31 21:27 ` Ingo Molnar
2006-05-31 21:41 ` Alan Cox
2006-05-31 21:43 ` Arjan van de Ven
2006-05-31 21:47 ` Ingo Molnar
2006-05-31 21:56 ` Arjan van de Ven
2006-05-31 22:00 ` Ingo Molnar
2006-05-31 22:02 ` Arjan van de Ven
2006-06-03 14:37 ` Steven Rostedt
2006-06-03 21:53 ` Alan Cox
2006-06-03 22:34 ` Steven Rostedt
2006-06-04 9:34 ` Arjan van de Ven
2006-06-04 13:16 ` Steven Rostedt
2006-06-04 15:38 ` Alan Cox
2006-06-04 15:44 ` Steven Rostedt
2006-06-04 16:10 ` Alan Cox
2006-06-04 16:22 ` Steven Rostedt
2006-06-04 21:26 ` Alan Cox
2006-06-04 21:28 ` Steven Rostedt
2006-06-04 21:44 ` Ingo Molnar
2006-06-05 1:04 ` Steven Rostedt [this message]
2006-06-06 3:33 ` [PATCH -mm] misroute-irq: Don't call desc->chip->end because of edge interrupts Steven Rostedt
2006-06-06 4:20 ` Andrew Morton
2006-06-06 10:46 ` Steven Rostedt
2006-06-06 8:01 ` Ingo Molnar
2006-06-06 10:50 ` Steven Rostedt
2006-06-06 21:48 ` Andrew Morton
2006-06-06 21:50 ` Ingo Molnar
2006-06-06 3:49 ` [RFC][PATCH -mm] postpone misrouted irqs when disabled Steven Rostedt
2006-06-01 9:46 ` [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq() Alan Cox
2006-06-01 10:02 ` Ingo Molnar
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=1149469474.29652.46.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alan@redhat.com \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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