* [PATCH v2] powerpc: handle simultaneous interrupts at once
@ 2017-03-16 8:55 Christophe Leroy
2017-06-05 10:21 ` [v2] " Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2017-03-16 8:55 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, Scott Wood
Cc: linux-kernel, linuxppc-dev
It often happens to have simultaneous interrupts, for instance
when having double Ethernet attachment. With the current
implementation, we suffer the cost of kernel entry/exit for each
interrupt.
This patch introduces a loop in __do_irq() to handle all interrupts
at once before returning.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
Changed from v1(RFC): simplified following remark from benh
arch/powerpc/kernel/irq.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index a018f5cae899..ba0cb6c2ee7d 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -522,7 +522,11 @@ void __do_irq(struct pt_regs *regs)
if (unlikely(!irq))
__this_cpu_inc(irq_stat.spurious_irqs);
else
- generic_handle_irq(irq);
+ do {
+ generic_handle_irq(irq);
+
+ irq = ppc_md.get_irq();
+ } while (irq);
trace_irq_exit(regs);
--
2.12.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [v2] powerpc: handle simultaneous interrupts at once
2017-03-16 8:55 [PATCH v2] powerpc: handle simultaneous interrupts at once Christophe Leroy
@ 2017-06-05 10:21 ` Michael Ellerman
2017-06-05 11:17 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-06-05 10:21 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras, Scott Wood
Cc: linuxppc-dev, linux-kernel
On Thu, 2017-03-16 at 08:55:45 UTC, Christophe Leroy wrote:
> It often happens to have simultaneous interrupts, for instance
> when having double Ethernet attachment. With the current
> implementation, we suffer the cost of kernel entry/exit for each
> interrupt.
>
> This patch introduces a loop in __do_irq() to handle all interrupts
> at once before returning.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/45cb08f4791ce6a15c54598b4cb73d
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [v2] powerpc: handle simultaneous interrupts at once
2017-06-05 10:21 ` [v2] " Michael Ellerman
@ 2017-06-05 11:17 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2017-06-05 11:17 UTC (permalink / raw)
To: Michael Ellerman, Christophe Leroy, Paul Mackerras, Scott Wood
Cc: linuxppc-dev, linux-kernel
On Mon, 2017-06-05 at 20:21 +1000, Michael Ellerman wrote:
> On Thu, 2017-03-16 at 08:55:45 UTC, Christophe Leroy wrote:
> > It often happens to have simultaneous interrupts, for instance
> > when having double Ethernet attachment. With the current
> > implementation, we suffer the cost of kernel entry/exit for each
> > interrupt.
> >
> > This patch introduces a loop in __do_irq() to handle all interrupts
> > at once before returning.
> >
> > Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> Applied to powerpc next, thanks.
>
> https://git.kernel.org/powerpc/c/45cb08f4791ce6a15c54598b4cb73d
Hrm, I hadn't noticed that patch...
We used to do that and then removed the code for it. There's a cost,
sometimes noticeable, to an extra call to ppc_md.get_irq.
Why not have your get_irq (or eoi) implementation set a per-cpu
requesting a new spin of the loop ?
We could move the xive force replay stuff to use the same thing.
Ben.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-05 11:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 8:55 [PATCH v2] powerpc: handle simultaneous interrupts at once Christophe Leroy
2017-06-05 10:21 ` [v2] " Michael Ellerman
2017-06-05 11:17 ` Benjamin Herrenschmidt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.