From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@osdl.org>
Cc: Ingo Molnar <mingo@redhat.com>, Komuro <komurojun-mbn@nifty.com>,
tglx@linutronix.de, Adrian Bunk <bunk@stusta.de>,
Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Use delayed disable mode of ioapic edge triggered interrupts
Date: Tue, 14 Nov 2006 22:14:39 -0700 [thread overview]
Message-ID: <m17ixxjnpc.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0611141706300.3349@woody.osdl.org> (Linus Torvalds's message of "Tue, 14 Nov 2006 17:17:53 -0800 (PST)")
Linus Torvalds <torvalds@osdl.org> writes:
> On Tue, 14 Nov 2006, Eric W. Biederman wrote:
>>
>> Hopefully this is the trivial patch that solves the problem.
>
> Ok, having looked more at this, I have to say that the whole
> "IRQ_DELAYED_DISABLE" thing seems very fragile indeed.
>
> It looks like we should do it not only for APIC edge-triggered interrupts,
> but for HT and MSI interrupts too, as far as I can tell (at least they
> also use the "handle_edge_irq" routine)
>
> So I'm wondering how many other cases there are that are missing this.
I think it is a good question.
The big one I did not set it on is the interrupt if it comes in
through ExtInt. I assume the 8259 is sane but I may be wrong.
> In that sense, Ingo's patch was a lot safer, although I still dislike it
> for all the other reasons I mentioned - it's simply wrong to re-send a
> level-triggered irq.
>
> I don't know MSI and HT interrupts well enough to tell whether they will
> re-trigger on their own when we unmask them, but the point is, this
> _looks_ like it might be incomplete.
Yes. I think there is an interrupt status bit there.
For at least one case in MSI we don't have a disable at all.
The truth is in practice I don't think it matters because I don't
think anyone actually disables MSI or hypertransport interrupts.
If it was going to change it would probably change per card.
But the real truth is that the hardware device knows what is going on.
The interrupt message is sent by the hardware device or it is not.
This isn't a case of can we detect an interrupt being raised by the
device while we disabled the interrupt at the device. This is a
case of we disable the interrupt at the device. So I think the whole
question of do we detect an interrupt raised by the device while
we have disabled interrupts on the device is silly.
So until I learn more I am going to assume that MSI and hypertransport
interrupts are sane like 8259 interrupts. If that makes sense.
> I think part of the problem is a bad interface. We should simply never set
> the IRQ handler on its own. It should be a field in the "irq_chip"
> structure, and we should use _different_ irq chip structures for level and
> edge-triggered. Then we should also add the "flags" thing there, and you
> could do something like
>
> static struct irq_chip level_ioapic_chip = {
> ..
>
> instead of making the insane decision to use the "same" chip for all
> ioapic things.
I think there is probably a sensible case for a separate structure.
At this point I have two questions.
- What is the easiest path to get us to a stable 2.6.19 where
everything works?
I don't think that is backing out genirq. But I haven't at all of
these corner cases.
I think for 2.6.19 we can get away with just my stupid patch, or
some simple variation of it.
- What is the sanest thing for long term maintenance, of irqs?
genirq is less code to maintain overall (a plus).
genirq helps us do things across architectures, which is nice.
genirq is also a little convoluted to read and to use a downside.
My gut feel is that there is room for a lot more cleanup in this
area but we probably need to stabilize what we have.
Since you aren't complaining about what the code actually does but
rather how the interface looks, I have a proposal. I assert that
the interface for registering an irq is much to general, and broad.
Instead of having:
irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
set_irq_chip_and_handler_name(irq, &ioapic_chip,
handle_edge_irq, "edge");
We should have a set of helper functions one for each common type
of interrupt.
set_irq_edge_lossy(irq, &ioapic_chip);
set_irq_edge(irq, &ioapic_chip);
set_irq_level(irq, &ioapic_chip);
The more stupid parameters we have to set the more likely
an implementor is to get it wrong.
Although I do agree to some extent it has been a bit of a strain
having both edge and level triggered interrupts with the same
methods. So if our goal is to make an even simpler interface
than what we have now I will be happy. Hopefully we can do all
of this in helper functions instead of having to rip up all of
the interrupt infrastructure one more time.
I really don't know. I'm tired and I want to see this code work.
Eric
next prev parent reply other threads:[~2006-11-15 5:15 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-08 2:33 Linux 2.6.19-rc5 Linus Torvalds
[not found] ` <20061108085235.GT4729@stusta.de>
2006-11-08 9:29 ` [discuss] 2.6.19-rc5: known regressions Jan Beulich
2006-11-08 10:21 ` Adrian Bunk
2006-11-08 9:34 ` Jens Axboe
2006-11-08 19:09 ` Alex Romosan
2006-11-08 19:29 ` Jens Axboe
2006-11-08 19:38 ` Alex Romosan
2006-11-08 19:45 ` Jens Axboe
2006-11-08 21:40 ` Alex Romosan
2006-11-08 20:03 ` Arjan van de Ven
2006-11-08 20:19 ` Jens Axboe
2006-11-08 11:04 ` Eric W. Biederman
2006-11-08 11:32 ` Thomas Gleixner
[not found] ` <7813413.118221162987983254.komurojun-mbn@nifty.com>
2006-11-08 16:00 ` Linus Torvalds
2006-11-10 12:42 ` Re: Re: 2.6.19-rc5: known regressions :SMP kernel can not generate ISA irq Komuro
2006-11-13 16:02 ` Linus Torvalds
2006-11-13 17:11 ` Eric W. Biederman
2006-11-13 20:44 ` Ingo Molnar
2006-11-13 21:11 ` Eric W. Biederman
2006-11-14 8:14 ` [patch] irq: do not mask interrupts by default Ingo Molnar
2006-11-14 8:20 ` Arjan van de Ven
2006-11-14 12:43 ` Komuro
2006-11-14 16:10 ` Linus Torvalds
2006-11-14 17:52 ` [PATCH] Use delayed disable mode of ioapic edge triggered interrupts Eric W. Biederman
2006-11-14 23:35 ` Linus Torvalds
2006-11-15 1:17 ` Linus Torvalds
2006-11-15 5:14 ` Eric W. Biederman [this message]
2006-11-15 16:06 ` Linus Torvalds
2006-11-15 16:58 ` Eric W. Biederman
2006-11-15 12:40 ` Komuro
[not found] ` <20061115090427.GA16173@elte.hu>
2006-11-15 16:13 ` [patch] genirq: do not mask interrupts by default Linus Torvalds
2006-11-15 17:46 ` Ingo Molnar
[not found] ` <m1y7qm425l.fsf@ebiederm.dsl.xmission.com>
[not found] ` <Pine.LNX.4.64.0611080745150.3667@g5.osdl.org>
2006-11-08 16:22 ` 2.6.19-rc5: known regressions Adrian Bunk
2006-11-08 23:11 ` Tim Chen
2006-11-09 2:49 ` Tim Chen
2006-11-09 5:10 ` Eric W. Biederman
2006-11-13 22:46 ` Tim Chen
2006-11-14 0:03 ` Eric W. Biederman
2006-11-08 9:43 ` Linux 2.6.19-rc5 Nigel Cunningham
2006-11-08 9:59 ` Alessandro Suardi
2006-11-08 10:04 ` Nigel Cunningham
2006-11-08 14:19 ` Gene Heskett
2006-11-08 15:43 ` Linus Torvalds
[not found] ` <20061111015035.GU4729@stusta.de>
2006-11-11 9:08 ` [discuss] 2.6.19-rc5: known regressions (v2) Rafael J. Wysocki
2006-11-11 9:25 ` Paolo Ornati
2006-11-11 10:49 ` Rafael J. Wysocki
2006-11-11 12:29 ` Paolo Ornati
2006-11-14 16:44 ` Paolo Ornati
2006-11-29 10:10 ` [SOLVED] " Paolo Ornati
2006-11-13 22:14 ` 2.6.19-rc5: known regressions with patches Adrian Bunk
2006-11-13 22:56 ` Brian King
2006-11-13 23:15 ` Linus Torvalds
2006-11-14 2:35 ` Jeff Garzik
2006-11-15 10:21 ` 2.6.19-rc5: known regressions (v3) Adrian Bunk
2006-11-15 10:35 ` Jens Axboe
2006-11-15 10:53 ` Adrian Bunk
2006-11-15 10:35 ` Eric Dumazet
2006-11-15 10:50 ` Andi Kleen
2006-11-15 16:40 ` William Cohen
2006-11-15 16:48 ` [discuss] " Andi Kleen
2006-11-15 18:39 ` Andrew Morton
2006-11-15 18:45 ` Andi Kleen
2006-11-15 19:07 ` Linus Torvalds
2006-11-15 19:23 ` Andi Kleen
2006-11-15 20:21 ` Andrew Morton
2006-11-15 21:18 ` Eric W. Biederman
2006-11-15 21:31 ` Andrew Morton
2006-11-16 10:55 ` Mikael Pettersson
2006-11-16 20:23 ` Andrew Morton
2006-11-17 9:59 ` Mikael Pettersson
2006-11-17 10:13 ` Andrew Morton
2006-11-19 3:05 ` Bill Davidsen
2006-11-17 10:29 ` Andi Kleen
2006-11-16 3:21 ` Andi Kleen
2006-11-16 5:05 ` Andrew Morton
2006-11-16 7:04 ` Andi Kleen
2006-11-16 15:34 ` William Cohen
2006-11-16 15:47 ` Andi Kleen
2006-11-16 21:32 ` Stephane Eranian
2006-11-22 10:28 ` Eric Dumazet
2006-11-22 10:36 ` Andi Kleen
2006-11-22 18:42 ` Andrew Morton
2006-12-16 11:20 ` Ray Lee
2006-11-22 17:59 ` William Cohen
2006-11-22 18:05 ` William Cohen
2006-11-22 18:26 ` Eric Dumazet
2006-11-15 11:06 ` Brice Goglin
2006-11-15 22:32 ` Adrian Bunk
2006-11-15 12:07 ` Alan
2006-11-15 15:52 ` Stephen Hemminger
2006-11-15 16:35 ` Eric W. Biederman
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=m17ixxjnpc.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@osdl.org \
--cc=bunk@stusta.de \
--cc=komurojun-mbn@nifty.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).