Speed Up Linux System Calls on Power
This guide shows you how to reduce the overhead of system calls on a Linux system running on POWER (ppc64/ppc64le) hardware. You’ll learn how to enable and tune the special optimizations that the POWER architecture offers, such as the system call vectored (scv) interface and the restart table, which can significantly improve performance for I/O-heavy and syscall-intensive workloads. No special hardware is required beyond a POWER processor, but you’ll need root access to modify kernel parameters.
What You’ll Need
- A Linux system on POWER hardware (IBM Power8, Power9, Power10, or later).
- Root or sudo access to change kernel boot parameters and sysctl settings.
- Basic familiarity with the command line and editing files in /etc.
- Optional: a benchmark tool like
perf,sysbench, or a custom microbenchmark to measure the impact.
Step-by-Step
- Check your POWER version and kernel support. Run
lscputo confirm you’re on ppc64/ppc64le. The optimizations described require a POWER9 or newer processor, and a kernel version 5.0 or later (ideally 5.10+). Check withuname -r. - Enable the system call vectored (scv) interface. The scv instruction provides a faster path for system calls, avoiding the overhead of the traditional ‘sc’ instruction. To enable it, add
scv=1to the kernel command line. Edit/etc/default/grub, find theGRUB_CMDLINE_LINUXline, and appendscv=1inside the quotes. Then runsudo update-grub(on Debian/Ubuntu) orsudo grub2-mkconfig -o /boot/grub2/grub.cfg(on RHEL/Fedora) and reboot. - Verify scv is active. After reboot, run
cat /proc/cpuinfoand look for thescvflag in the ‘features’ line. If it’s present, the kernel is using scv for system calls. You can also checkdmesg | grep scvfor confirmation. - Enable the restart table for faster syscall restart. When a system call is interrupted by a signal, the kernel must restart it. The restart table (introduced in kernel 5.10) speeds this up. It’s controlled by a sysctl:
kernel.restart_table. Set it to 1 withsudo sysctl -w kernel.restart_table=1. To make it permanent, addkernel.restart_table=1to/etc/sysctl.conf(or a file in/etc/sysctl.d/). - Optimize syscall entry for POWER9 and newer. For POWER9 and later, you can also enable the ‘scv’ entry for the ‘futex’ and ‘clock_gettime’ calls, which are common in multithreaded applications. This is done via the
kernel.scv_use_restart_tablesysctl. Set it to 1 withsudo sysctl -w kernel.scv_use_restart_table=1and persist it as above. - Consider the ‘noexec’ and ‘nosuid’ mount options. While not directly syscall-related, mounting filesystems with
noexecandnosuidcan reduce the security checks the kernel performs on each file access, which can indirectly reduce syscall overhead. Add these to the relevant entries in/etc/fstab(e.g., for/homeor/tmp), then remount withsudo mount -o remount /home. - Use the ‘perf’ tool to measure. After making changes, benchmark before and after to confirm improvement. For example, run
perf stat -e syscalls:sys_enter_* ./your_benchmarkto count syscall entries. You should see a lower overhead per syscall, or a higher throughput in syscall-heavy workloads. - Reboot and verify persistence. After editing sysctl.conf and grub, reboot and re-check
cat /proc/sys/kernel/restart_tableandcat /proc/sys/kernel/scv_use_restart_tableto ensure they are set to 1.
Common Mistakes
- Forgetting to reboot after changing grub. The
scv=1parameter only takes effect after a reboot. - Using the wrong sysctl name. Ensure it’s
kernel.restart_tableandkernel.scv_use_restart_table, notkernel.scvor something similar. - Assuming all POWER CPUs support scv. Power8 and earlier do not have the scv instruction. Check your processor version first.
- Not measuring before and after. Without a benchmark, you won’t know if the changes helped or hurt.
- Editing /etc/sysctl.conf incorrectly. Use a new line for each parameter, and don’t put spaces around the equals sign.
Tips
- For maximum benefit, combine these optimizations with a kernel compiled with the
CONFIG_PPC_FAST_ENDIAN_SWITCHoption if you use a mixed-endian environment. - If you’re running a distribution with a custom kernel, ensure it has the scv and restart table patches backported. Check the kernel changelog.
- Use
strace -cto get a summary of syscall counts and times for your application to identify which calls dominate. - On Power10, the scv path is even faster due to the new ‘scv 1’ instruction. Make sure your kernel is 5.13+ to take advantage of it.
- If you’re using containers, the host kernel must have these features enabled; the container itself doesn’t need configuration.
Troubleshooting
- System fails to boot after adding scv=1. This is rare but possible with very old kernels. Boot with a rescue kernel, remove the parameter, and update your kernel first.
- scv flag not showing in /proc/cpuinfo. Check that you’re on POWER9 or newer, and that your kernel is 5.0+. If so, confirm the boot parameter is actually in effect by running
cat /proc/cmdline. - sysctl setting resets after reboot. Make sure you added the line to a file in
/etc/sysctl.d/with a name that sorts before other files that might override it. Checksysctl --systemto see which file sets it. - No performance improvement. If your workload is not syscall-bound, you won’t see a difference. Also, some older kernels had regressions in scv; try updating to the latest stable kernel.
- Application crashes after enabling restart_table. This is extremely rare and usually indicates a kernel bug. If it happens, disable the sysctl and report the issue to your kernel maintainer.
Frequently Asked Questions
What exactly is the ‘scv’ instruction?
The ‘scv’ (system call vectored) instruction is a POWER9+ feature that provides a faster way to enter the kernel for system calls, reducing the overhead compared to the traditional ‘sc’ instruction. It avoids some of the serialization and context-switch costs.
Is this safe for production systems?
Yes, these are well-tested kernel features. The scv interface has been used by default in many Linux distributions on POWER since kernel 5.0. The restart table and scv_use_restart_table are newer but have been stable since kernel 5.10.
Do I need to recompile my applications?
No. These are kernel-level optimizations. Applications automatically benefit from faster system calls without recompilation, as long as they use standard libc syscall wrappers.
Will this work on Power8?
No. The scv instruction is only available on POWER9 and later. Power8 users can still benefit from other kernel optimizations, but not the scv path.
How much speedup can I expect?
It varies widely depending on the workload. Syscall-heavy workloads like database servers, web servers, or file I/O can see a 5-15% improvement in syscall throughput. Microbenchmarks that do nothing but syscalls can see up to 30% improvement.
Can I disable these features if I have problems?
Yes. Simply remove the scv=1 boot parameter and set the sysctls back to 0. After a reboot, the system will revert to the traditional syscall path.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.