VOOZH about

URL: https://www.phoronix.com/news/Linux-616-Faster-Exit-User-Mode

⇱ Linux 6.16 Will Be Able To Exit User Mode Faster: 2~11% Improvement - Phoronix


👁 Phoronix

Linux 6.16 Will Be Able To Exit User Mode Faster: 2~11% Improvement

Written by Michael Larabel in Linux Kernel on 28 May 2025 at 10:58 AM EDT. 15 Comments
While the "core/entry" changes for the Linux kernel merge window aren't typically too exciting to write about, there is a new optimization for all CPU architectures worth mentioning for the Linux 6.16 cycle.

The core/entry pull request was sent out earlier this week and already merged to mainline. For RISC-V and LoongArch it does move some code from Assembly to C and additionally delivering a nice speed boost for ret_from_fork() on RISC-V. But it also contains a generic optimization too as part of these Linux 6.16 changes.

The syscall_exit_to_user_mode() function is now inlined on Linux 6.16 for all architectures to avoid a function call and letting the compiler carry out better optimizations. The syscall_exit_to_user_mode is for the syscall to exit to user mode preparation.

Charlie Jenkins of Rivos who authored this optimization patch to inline syscall_exit_to_user_mode noted on the patch message:
"Testing was done with the byte-unixbench 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"

Not bad for a small patch and to just inline the code to better leverage compiler optimizations.

The code is merged and ready for the world in Linux 6.16.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.