public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: handle_fasteoi_irq vs IRQ_INPROGRESS && IRQ_DISABLED
@ 2007-08-21  9:17 Jarek Poplawski
  2007-08-21 10:35 ` Jarek Poplawski
  0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2007-08-21  9:17 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, linux-kernel


Hi,

I've still some doubts about these irq handlers and I hope somebody
could explain some of these (despite my problems with earlier such
explanations, sorry...):

1. According to some well-known Intel's manual (vol.3A page 8-41)
lapic can interrupt irq handler dispatching higher-priority irq; it
seems, such an event is possible during handle_IRQ_event, and would
be treated by "common" handlers with IRQ_INPROGRESS; but:

a) handle_level_irq and handle_edge_irq do unconditional ack-masking
and return; so, I wonder how, after finishing with this current one,
the higher-priority level type and masked irq could find it's way
home/cpu? (edge type would be retriggered, of course)

b) handle_fasteoi_irq acks but doesn't mask, so isn't it possible
this irq would be repeated by ioapic soon, maybe with some looping?
BTW: below is my patch proposal to exclude such thing at least when
IRQ_DISABLED.

2. I wonder, why handle_edge_irq kstat_cpu counter works different
than others (i.e. counts less).

Thanks,
Jarek P.

-------->

Don't let handle_fasteoi_irq() delay irq masking when IRQ_INPROGRESS
&& IRQ_DISABLED.

Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>

---

diff -Nurp 2.6.23-rc2-/kernel/irq/chip.c 2.6.23-rc2/kernel/irq/chip.c
--- 2.6.23-rc2-/kernel/irq/chip.c	2007-07-09 01:32:17.000000000 +0200
+++ 2.6.23-rc2/kernel/irq/chip.c	2007-08-21 08:50:36.000000000 +0200
@@ -392,7 +392,8 @@ handle_fasteoi_irq(unsigned int irq, str
 
 	spin_lock(&desc->lock);
 
-	if (unlikely(desc->status & IRQ_INPROGRESS))
+	if (unlikely((desc->status & (IRQ_INPROGRESS | IRQ_DISABLED))
+			== IRQ_INPROGRESS))
 		goto out;
 
 	desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] genirq: handle_fasteoi_irq vs IRQ_INPROGRESS && IRQ_DISABLED
  2007-08-21  9:17 [PATCH] genirq: handle_fasteoi_irq vs IRQ_INPROGRESS && IRQ_DISABLED Jarek Poplawski
@ 2007-08-21 10:35 ` Jarek Poplawski
  2007-08-21 11:21   ` Jarek Poplawski
  0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2007-08-21 10:35 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, linux-kernel

On Tue, Aug 21, 2007 at 11:17:00AM +0200, Jarek Poplawski wrote:
> 
> Hi,
> 
> I've still some doubts about these irq handlers and I hope somebody
> could explain some of these (despite my problems with earlier such
> explanations, sorry...):
> 
> 1. According to some well-known Intel's manual (vol.3A page 8-41)
> lapic can interrupt irq handler dispatching higher-priority irq; it
> seems, such an event is possible during handle_IRQ_event, and would
> be treated by "common" handlers with IRQ_INPROGRESS; but:

OOPS!!! Of course, I got this wrong again: this IRQ_INPROGRESS is
for another irq... Sorry!

But, then, it seems such IRQ_INPROGRESS shouldn't be possible at all
with properly working lapic? Or do I miss something...

Jarek P. 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] genirq: handle_fasteoi_irq vs IRQ_INPROGRESS && IRQ_DISABLED
  2007-08-21 10:35 ` Jarek Poplawski
@ 2007-08-21 11:21   ` Jarek Poplawski
  0 siblings, 0 replies; 3+ messages in thread
From: Jarek Poplawski @ 2007-08-21 11:21 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, linux-kernel

On Tue, Aug 21, 2007 at 12:35:27PM +0200, Jarek Poplawski wrote:
> On Tue, Aug 21, 2007 at 11:17:00AM +0200, Jarek Poplawski wrote:
> > 
> > Hi,
> > 
> > I've still some doubts about these irq handlers and I hope somebody
> > could explain some of these (despite my problems with earlier such
> > explanations, sorry...):
> > 
> > 1. According to some well-known Intel's manual (vol.3A page 8-41)
> > lapic can interrupt irq handler dispatching higher-priority irq; it
> > seems, such an event is possible during handle_IRQ_event, and would
> > be treated by "common" handlers with IRQ_INPROGRESS; but:
> 
> OOPS!!! Of course, I got this wrong again: this IRQ_INPROGRESS is
> for another irq... Sorry!
> 
> But, then, it seems such IRQ_INPROGRESS shouldn't be possible at all
> with properly working lapic? Or do I miss something...

I see... So, it's possible for handle_level_irq and handle_edge_irq
because of this early acking. (Then unmasking should work OK and my
1.a is invalid.)

But handle_fasteoi_irq? If it really needs IRQ_INPROGRESS check, this
patch, and maybe something more, seems needed too.

Jarek P.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-21 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21  9:17 [PATCH] genirq: handle_fasteoi_irq vs IRQ_INPROGRESS && IRQ_DISABLED Jarek Poplawski
2007-08-21 10:35 ` Jarek Poplawski
2007-08-21 11:21   ` Jarek Poplawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox