Commit 761c2f3c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: PER_CPU irq optimisations

From: Anton Blanchard <anton@samba.org>

Another decent optimisation found in the ia64 port, dont take the irq
descriptor lock or do the note_interrupt stuff on PER_CPU irqs (ie IPIs).
parent 7ef1c5d1
......@@ -476,8 +476,18 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
struct irqaction *action;
int cpu = smp_processor_id();
irq_desc_t *desc = irq_desc + irq;
irqreturn_t action_ret;
kstat_cpu(cpu).irqs[irq]++;
if (desc->status & IRQ_PER_CPU) {
/* no locking required for CPU-local interrupts: */
ack_irq(irq);
action_ret = handle_irq_event(irq, regs, desc->action);
desc->handler->end(irq);
return;
}
spin_lock(&desc->lock);
ack_irq(irq);
/*
......@@ -485,8 +495,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
WAITING is used by probe to mark irqs that are being tested
*/
status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
if (!(status & IRQ_PER_CPU))
status |= IRQ_PENDING; /* we _want_ to handle it */
status |= IRQ_PENDING; /* we _want_ to handle it */
/*
* If the IRQ is disabled for whatever reason, we cannot
......@@ -509,8 +518,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
goto out;
}
status &= ~IRQ_PENDING; /* we commit to handling */
if (!(status & IRQ_PER_CPU))
status |= IRQ_INPROGRESS; /* we are handling it */
status |= IRQ_INPROGRESS; /* we are handling it */
}
desc->status = status;
......@@ -534,8 +542,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
* SMP environment.
*/
for (;;) {
irqreturn_t action_ret;
spin_unlock(&desc->lock);
action_ret = handle_irq_event(irq, regs, action);
spin_lock(&desc->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment