[PATCH OLK-6.6 0/1] arm/syscalls: mark syscall invocation as likely in
Backport mainline patch to optimize syscall performance. Can Peng (1): arm/syscalls: mark syscall invocation as likely in invoke_syscall arch/arm64/kernel/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/18531 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/SD3... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/18531 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/SD3...
From: Can Peng <pengcan@kylinos.cn> mainline inclusion from mainline-v6.18-rc1 commit da9e5c04be589524101aac31746902b6803581e4 category: performance bugzilla: https://gitee.com/openeuler/kernel/issues/ID3BVI CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- The invoke_syscall() function is overwhelmingly called for valid system call entries. Annotate the main path with likely() to help the compiler generate better branch prediction hints, reducing CPU pipeline stalls due to mispredictions. This is a micro-optimization targeting syscall-heavy workloads [1]. Link: https://lore.kernel.org/r/20250922121730.986761-1-pengcan@kylinos.cn [1] Signed-off-by: Can Peng <pengcan@kylinos.cn> Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- arch/arm64/kernel/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 558e9c9da8a4..07cc0dfef1fe 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -45,7 +45,7 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, add_random_kstack_offset(); - if (scno < sc_nr) { + if (likely(scno < sc_nr)) { syscall_fn_t syscall_fn; syscall_fn = syscall_table[array_index_nospec(scno, sc_nr)]; ret = __invoke_syscall(regs, syscall_fn); -- 2.20.1
participants (2)
-
patchwork bot -
Zheng Zengkai