public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Li Qiang <liqiang01@kylinos.cn>
To: will@kernel.org
Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: add unlikely hint to MTE async fault check in el0_svc_common
Date: Sun, 28 Sep 2025 17:01:21 +0800	[thread overview]
Message-ID: <20250928090121.3068976-1-liqiang01@kylinos.cn> (raw)
In-Reply-To: <aNEsDswLSpBkf-5S@willie-the-truck>

> Does this result in a measurable performance difference?
> Will

Hi,

I did not observe a measurable performance difference in micro-benchmarks 
(e.g. syscall latency tests), since asynchronous MTE faults are extremely 
rare and the branch is almost never taken.

However, `el0_svc_common()` is a very hot path. Without the `unlikely()` 
hint, the compiler may not optimize for the common case, and after an 
I-cache eviction or branch predictor state reset the fault check can 
be mispredicted. Marking it as `unlikely()` makes the fast path layout 
clearer and reduces the chance of branch misprediction in cold-start 
situations, consistent with how other rare-condition checks are annotated.

Thanks,
Li Qiang


  reply	other threads:[~2025-09-28  9:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19  3:33 [PATCH] arm64: add unlikely hint to MTE async fault check in el0_svc_common Li Qiang
2025-09-22 10:59 ` Will Deacon
2025-09-28  9:01   ` Li Qiang [this message]
2025-11-11 20:17 ` Catalin Marinas

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=20250928090121.3068976-1-liqiang01@kylinos.cn \
    --to=liqiang01@kylinos.cn \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox