Subject: Re: [PATCH 2/3] genirq: use runtime constant to optimize handle_arch_irq access

From: Jisheng Zhang <[email-masked]>
Date: Mon, 23 Feb 2026 20:41:55 +0800

On Sun, Feb 22, 2026 at 11:06:11PM +0100, Thomas Gleixner wrote:
> On Fri, Feb 20 2026 at 17:09, Jisheng Zhang wrote:
> > Currently, on GENERIC_IRQ_MULTI_HANDLER platforms, the handle_arch_irq
> > is a pointer which is set during booting, and every irq processing needs
> > to access it, so it sits in hot code path. We can use the
> > runtime constant mechanism which was introduced by Linus to speed up
> > its accessing.
> 
> The proper solution is to use a static call and update it in
> set_handle_irq().  That removes the complete indirect call issue from
> the hot path.

+ Ard, Mark,

Good idea. The remaining problem is no static call support for current
GENERIC_IRQ_MULTI_HANDLER (or similar, arm64 e.g) platforms.

For arm64, Ard tried to add the static call support[1] in 2021, but
Mark concerned "compiler could easily violate our expectations in
future"[2], and asked for static calls "critical rather than a
nice-to-have" usage.

Hi Ard, Mark,

Could this irq performance improvement be used as a "critical" usage for
arm64 static call? Per my test, about 6.5% improvement was seen on quad CA55.

Another alternative: 
disable static call if CFI is enabled, and give the platform/SoC users
chance to enable static call to benefit from it.

Any comment is appreciated.

Thanks

[1] https://www.spinics.net/lists/arm-kernel/msg931861.html

[2] https://www.spinics.net/lists/arm-kernel/msg932481.html

> Thanks,
>         tglx