[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250928090121.3068976-1-liqiang01@kylinos.cn>
Date: Sun, 28 Sep 2025 17:01:21 +0800
From: Li Qiang <liqiang01@...inos.cn>
To: will@...nel.org
Cc: catalin.marinas@....com,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: add unlikely hint to MTE async fault check in el0_svc_common
> 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
Powered by blists - more mailing lists