[PATCH] arm64: add unlikely hint to MTE async fault check in el0_svc_common
Li Qiang
liqiang01 at kylinos.cn
Sun Sep 28 02:01:21 PDT 2025
> 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
More information about the linux-arm-kernel
mailing list