public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] entry: Move ret_from_fork() to C and inline syscall_exit_to_user_mode()
@ 2025-03-20 17:29 Charlie Jenkins
  2025-03-20 17:29 ` [PATCH v6 1/4] riscv: entry: Convert ret_from_fork() to C Charlie Jenkins
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Charlie Jenkins @ 2025-03-20 17:29 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Huacai Chen, WANG Xuerui,
	Thomas Gleixner, Peter Zijlstra, Andy Lutomirski, Alexandre Ghiti,
	Arnd Bergmann, Albert Ou, Alexandre Ghiti
  Cc: linux-riscv, linux-kernel, loongarch, Charlie Jenkins

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.

The Intel bot also reported "kernel test robot noticed a 1.9%
improvement of stress-ng.seek.ops_per_sec" [2]

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
[2] https://lore.kernel.org/linux-riscv/202502051555.85ae6844-lkp@intel.com/

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
Changes in v6:
- Update commit message of patch 4 to contain performance numbers
- Link to v5: https://lore.kernel.org/r/20250305-riscv_optimize_entry-v5-0-6507b5dff3ce@rivosinc.com

Changes in v5:
- Rebase on 6.14-rc5
- Link to v4: https://lore.kernel.org/r/20250127-riscv_optimize_entry-v4-0-868cf7702dc9@rivosinc.com

Changes in v4:
- I had messed up warning for ct_state() on rebase, correct that issue
- Link to v3: https://lore.kernel.org/r/20250124-riscv_optimize_entry-v3-0-869f36b9e43b@rivosinc.com

Changes in v3:
- Fixup comment to properly reflect args (Alex)
- Fix prototypes for loongarch (Huacai)
- Link to v2: https://lore.kernel.org/r/20250123-riscv_optimize_entry-v2-0-7c259492d508@rivosinc.com

Changes in v2:
- Fixup compilation issues for loongarch
- Fixup compilation issues with CONFIG_CONTEXT_TRACKING_USER
- Link to v1: https://lore.kernel.org/r/20250122-riscv_optimize_entry-v1-0-4ee95559cfd0@rivosinc.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/asm-prototypes.h |  8 +++++
 arch/loongarch/kernel/entry.S               | 22 ++++++-------
 arch/loongarch/kernel/process.c             | 33 +++++++++++++++----
 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, 119 insertions(+), 79 deletions(-)
---
base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6
change-id: 20240402-riscv_optimize_entry-583843420325
-- 
- Charlie


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-05-05  4:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20 17:29 [PATCH v6 0/4] entry: Move ret_from_fork() to C and inline syscall_exit_to_user_mode() Charlie Jenkins
2025-03-20 17:29 ` [PATCH v6 1/4] riscv: entry: Convert ret_from_fork() to C Charlie Jenkins
2025-04-29  6:33   ` [tip: core/entry] " tip-bot2 for Charlie Jenkins
2025-03-20 17:29 ` [PATCH v6 2/4] riscv: entry: Split ret_from_fork() into user and kernel Charlie Jenkins
2025-03-21  6:36   ` Alexandre Ghiti
2025-04-29  6:33   ` [tip: core/entry] " tip-bot2 for Charlie Jenkins
2025-03-20 17:29 ` [PATCH v6 3/4] LoongArch: entry: Migrate ret_from_fork() to C Charlie Jenkins
2025-04-29  6:33   ` [tip: core/entry] " tip-bot2 for Charlie Jenkins
2025-05-05  4:58   ` [PATCH v6 3/4] " Huacai Chen
2025-03-20 17:29 ` [PATCH v6 4/4] entry: Inline syscall_exit_to_user_mode() Charlie Jenkins
2025-04-29  6:33   ` [tip: core/entry] " tip-bot2 for Charlie Jenkins
2025-03-21 21:22 ` [PATCH v6 0/4] entry: Move ret_from_fork() to C and inline syscall_exit_to_user_mode() Thomas Gleixner
2025-04-28 21:54   ` Charlie Jenkins
2025-04-29  6:22     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox