From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CC50C43458 for ; Mon, 29 Jun 2026 13:08:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gpmm91xC7z30hP; Mon, 29 Jun 2026 23:07:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=113.46.200.221 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1782738473; cv=none; b=Kncoccf5nkWff0vKs7Bh44rkzjH//4IBerN+IVkVCmGg6Xgse1PdAbR/skGajqjKpESz2OIdw1TLKfh6wgAwN6WlFr3OGkKo7wmVmAkWQAsP3VxqAYf74fFOxWkryhbqPvxrwotshg3scqEaoyqqcNWMXGenKMWKjMyAmqlooZABg2aU4gT43bka3UfUzclmA2hf8wPIbHMPvwBNn4lP1AOYpDb+qNbkQHeSQAqUtGyzZTgv13OZ4YohT0NZpXlVQdJHi0mTqrkNSPvTDLae6aJUQr6cJG0Ah9mxFbPNGywtmBYJQ52PORD0wqsT45pnyNxlwvUH+K7R2Y4s6yGovQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1782738473; c=relaxed/relaxed; bh=+4M70Gapyp6lHxcKfDwoDJcCaABh3//z1ZN+1TfSdMw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iEyqoOkc6j+ZNGBWVGTP9bSKkQ3HQ4oKYbwlNLwStbsO/PH5ixi7VvCWOF8bhUfCoEVU8nBpVvAhxY5oMTPSiExYPu93qo2q6/8M2e7mJzT16CKCJazDvZ4/MVHM7LrfCzPJ588TTbJYLgiTBndDL146G34GFWkB9Z4Q4B78v0V2hR0wYiKIa4Pkd0Y6f1e1vBilz11Zw4gYwWrqXzrHsqAwKU6DR+OV4fBpRobE4CRg2EPLIaRGg+IDcwbYLhPXHM0mAewbwFhwPEItyMtnAvScH5Dy7Uuwo7vywH+/mkDqGVX2FHThO1r1eneIomfWP3Xh2tjCmdx3hhOzVDoGjw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=cSATadQt; dkim-atps=neutral; spf=pass (client-ip=113.46.200.221; helo=canpmsgout06.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=cSATadQt; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=113.46.200.221; helo=canpmsgout06.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4gpmm81MbGz30Vw for ; Mon, 29 Jun 2026 23:07:52 +1000 (AEST) dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=+4M70Gapyp6lHxcKfDwoDJcCaABh3//z1ZN+1TfSdMw=; b=cSATadQt9PmNn538c0HHU4sX8smMeILhM4/tfoRnYuXf0zwowoLl3eZcV10IFFxBuD4+cb08H +KSbgdGzMyMpvYFbzcGOgEDWHH66J/pCKAly7VOfjRPdrY2/LCxyITtutjzl5BZTqlAVvhPbgi3 gxod+gURdaXV7rMOTz85YpE= Received: from mail.maildlp.com (unknown [172.19.162.223]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4gpmYZ00f1zRhr1; Mon, 29 Jun 2026 20:58:41 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 3B07540575; Mon, 29 Jun 2026 21:07:49 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 29 Jun 2026 21:07:45 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v16 17/18] arm64: Inline el0_svc_common() Date: Mon, 29 Jun 2026 21:06:15 +0800 Message-ID: <20260629130616.642022-18-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260629130616.642022-1-ruanjinjie@huawei.com> References: <20260629130616.642022-1-ruanjinjie@huawei.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To dggpemf500011.china.huawei.com (7.185.36.131) After converting arm64 to Generic Entry framework, the compiler no longer inlines el0_svc_common() into its caller do_el0_svc(). This introduces a small but measurable overhead in the critical system call path. Manually forcing el0_svc_common() to be inlined restores the performance. Benchmarking with perf bench syscall basic on a Kunpeng 920 platform (based on v6.19-rc1) shows a ~1% performance uplift. Inlining this function reduces function prologue/epilogue overhead and allows for better compiler optimization in the hot system call dispatch path. | Metric | W/O this patch | With this patch | Change | | ---------- | -------------- | --------------- | --------- | | Total time | 2.195 [sec] | 2.171 [sec] | ↓1.1% | | usecs/op | 0.219575 | 0.217192 | ↓1.1% | | ops/sec | 4,554,260 | 4,604,225 | ↑1.1% | Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Reviewed-by: Ada Couprie Diaz Reviewed-by: Linus Walleij Reviewed-by: Yeoreum Yun Reviewed-by: Kevin Brodsky Signed-off-by: Jinjie Ruan --- arch/arm64/kernel/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 41a3b70a9374..e0a98fac3b85 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -55,8 +55,8 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, syscall_set_return_value(current, regs, 0, ret); } -static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, - const syscall_fn_t syscall_table[]) +static __always_inline void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, + const syscall_fn_t syscall_table[]) { unsigned long flags = read_thread_flags(); unsigned long work; -- 2.34.1