[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250122-riscv_optimize_entry-v1-0-4ee95559cfd0@rivosinc.com>
Date: Wed, 22 Jan 2025 14:56:19 -0800
From: Charlie Jenkins <charlie@...osinc.com>
To: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>, Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>, Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>, Andy Lutomirski <luto@...nel.org>,
Alexandre Ghiti <alexghiti@...osinc.com>
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev, Charlie Jenkins <charlie@...osinc.com>
Subject: [PATCH 0/4] entry: Move ret_from_fork() to C and inline
syscall_exit_to_user_mode()
Similar to commit 221a164035fd ("entry: Move
syscall_enter_from_user_mode() to header file"), move
syscall_exit_to_user_mode() to the header file as well.
Testing was done with the byte-unixbench [1] syscall benchmark (which
calls getpid) and QEMU. On riscv I measured a 7.09246% improvement, on
x86 a 2.98843% improvement, on loongarch a 6.07954% improvement, and on
s390 a 11.1328% improvement.
Since this is on QEMU, I know these numbers are not perfect, but they
show a trend of general improvement across all architectures that use
the generic entry code.
[1] https://github.com/kdlucas/byte-unixbench
Signed-off-by: Charlie Jenkins <charlie@...osinc.com>
---
Charlie Jenkins (4):
riscv: entry: Convert ret_from_fork() to C
riscv: entry: Split ret_from_fork() into user and kernel
loongarch: entry: Migrate ret_from_fork() to C
entry: Inline syscall_exit_to_user_mode()
arch/loongarch/include/asm/switch_to.h | 8 ++++++
arch/loongarch/kernel/entry.S | 22 +++++++--------
arch/loongarch/kernel/process.c | 36 ++++++++++++++++++++----
arch/riscv/include/asm/asm-prototypes.h | 2 ++
arch/riscv/kernel/entry.S | 20 ++++++++------
arch/riscv/kernel/process.c | 21 ++++++++++++--
include/linux/entry-common.h | 43 +++++++++++++++++++++++++++--
kernel/entry/common.c | 49 +--------------------------------
8 files changed, 122 insertions(+), 79 deletions(-)
---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20240402-riscv_optimize_entry-583843420325
--
- Charlie
Powered by blists - more mailing lists