All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
	ardb@kernel.org, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>, Guo Ren <guoren@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org
Subject: Re: [PATCH 2/3] genirq: use runtime constant to optimize handle_arch_irq access
Date: Mon, 23 Feb 2026 21:22:44 +0800	[thread overview]
Message-ID: <aZxUpATkNI5_PbNl@xhacker> (raw)
In-Reply-To: <aZxSEoFkXMg18qLV@J2N7QTR9R3>

On Mon, Feb 23, 2026 at 01:11:46PM +0000, Mark Rutland wrote:
> On Mon, Feb 23, 2026 at 08:41:55PM +0800, Jisheng Zhang wrote:
> > 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.
> 
> There are various reasons for not supporting static calls, and in
> general we end up having to have a fall-back path that's *more*
> expensive than just loading the pointer.

indeed, if arch doesn't support static call, the fall-back addes one
more loading overhead.

> 
> > 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],
> 
> To be clear, that's ONE specific concern, not the ONLY reason.
> 
> > 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.
> 
> As per my other mail, does this meaningfully affect a real workload?

This improves generic irq processcing, I think all real workload is affected.

> 
> > Another alternative: disable static call if CFI is enabled, and give
> > the platform/SoC users chance to enable static call to benefit from
> > it.
> 
> Who is this actually going to matter to?
> 

WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <jszhang@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
	ardb@kernel.org, Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>, Guo Ren <guoren@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org
Subject: Re: [PATCH 2/3] genirq: use runtime constant to optimize handle_arch_irq access
Date: Mon, 23 Feb 2026 21:22:44 +0800	[thread overview]
Message-ID: <aZxUpATkNI5_PbNl@xhacker> (raw)
In-Reply-To: <aZxSEoFkXMg18qLV@J2N7QTR9R3>

On Mon, Feb 23, 2026 at 01:11:46PM +0000, Mark Rutland wrote:
> On Mon, Feb 23, 2026 at 08:41:55PM +0800, Jisheng Zhang wrote:
> > 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.
> 
> There are various reasons for not supporting static calls, and in
> general we end up having to have a fall-back path that's *more*
> expensive than just loading the pointer.

indeed, if arch doesn't support static call, the fall-back addes one
more loading overhead.

> 
> > 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],
> 
> To be clear, that's ONE specific concern, not the ONLY reason.
> 
> > 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.
> 
> As per my other mail, does this meaningfully affect a real workload?

This improves generic irq processcing, I think all real workload is affected.

> 
> > Another alternative: disable static call if CFI is enabled, and give
> > the platform/SoC users chance to enable static call to benefit from
> > it.
> 
> Who is this actually going to matter to?
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2026-02-23 13:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20  9:09 [PATCH 0/3] use runtime constant to optimize handle_arch_irq access Jisheng Zhang
2026-02-20  9:09 ` Jisheng Zhang
2026-02-20  9:09 ` [PATCH 1/3] vmlinux.lds.h: add _handle_arch_irq RUNTIME_CONST section Jisheng Zhang
2026-02-20  9:09   ` Jisheng Zhang
2026-02-24  2:01   ` Guo Ren
2026-02-24  2:01     ` Guo Ren
2026-02-20  9:09 ` [PATCH 2/3] genirq: use runtime constant to optimize handle_arch_irq access Jisheng Zhang
2026-02-20  9:09   ` Jisheng Zhang
2026-02-22 22:06   ` Thomas Gleixner
2026-02-22 22:06     ` Thomas Gleixner
2026-02-23 12:41     ` Jisheng Zhang
2026-02-23 12:41       ` Jisheng Zhang
2026-02-23 13:11       ` Mark Rutland
2026-02-23 13:11         ` Mark Rutland
2026-02-23 13:22         ` Jisheng Zhang [this message]
2026-02-23 13:22           ` Jisheng Zhang
2026-02-23 13:55           ` Mark Rutland
2026-02-23 13:55             ` Mark Rutland
2026-02-24  1:40   ` Guo Ren
2026-02-24  1:40     ` Guo Ren
2026-02-24  1:59     ` Guo Ren
2026-02-24  1:59       ` Guo Ren
2026-02-20  9:09 ` [PATCH 3/3] arm64: " Jisheng Zhang
2026-02-20  9:09   ` Jisheng Zhang
2026-02-20 12:34   ` Leo Yan
2026-02-20 12:34     ` Leo Yan
2026-02-20 13:16     ` Jisheng Zhang
2026-02-20 13:16       ` Jisheng Zhang
2026-02-20 13:34       ` Jisheng Zhang
2026-02-20 13:34         ` Jisheng Zhang
2026-02-20 16:47         ` Leo Yan
2026-02-20 16:47           ` Leo Yan
2026-02-21  0:14           ` Jisheng Zhang
2026-02-21  0:14             ` Jisheng Zhang
2026-02-23  9:15             ` Leo Yan
2026-02-23  9:15               ` Leo Yan
2026-02-25 14:40               ` Jisheng Zhang
2026-02-25 14:40                 ` Jisheng Zhang
2026-02-23 12:56   ` Mark Rutland
2026-02-23 12:56     ` Mark Rutland
2026-02-23 12:58     ` Jisheng Zhang
2026-02-23 12:58       ` Jisheng Zhang

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=aZxUpATkNI5_PbNl@xhacker \
    --to=jszhang@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=guoren@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=tglx@kernel.org \
    --cc=will@kernel.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 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.