The system's swap space preference can be adjusted using the
vm.swappiness sysctl parameter. The default value is "30", which means that the kernel will avoid swapping processes to disk as much as possible and will instead try to keep as much data as possible in memory. A lower swappiness value generally leads to improved performance but may lead to decreased stability if the system runs out of memory.
vm.vfs_cache_pressure is a kernel parameter that sets the tendency of the kernel to reclaim inode and dentry cache. By default, it is set to "100" and a lower value means the kernel will tend to cache more inode and dentry information in memory. To improve performance, you can try to lower the value of
vm.vfs_cache_pressure to improve file system performance by having more file system metadata cached in memory.
Both values can be changed in the
Replace udev with systemd for faster boots and set compression algorithm to zstd and compression level to 2 because compression ratio increase isn't worth the increased latency.
(bellow isnt the whole file, just the parts that needs changes)
HOOKS="base systemd autodetect... COMPRESSION="zstd" COMPRESSION_OPTIONS=(-2)
Zswap is a kernel feature that caches swap pages in RAM, compressing them before storing. It improves performance by reducing disk I/O when the system needs to swap.
Zram is a RAM-based swap device that does not require a backing swap device.
For zswap, use the following recommended configurations:
# echo zstd > /sys/module/zswap/parameters/compressor # echo 10 > /sys/module/zswap/parameters/max_pool_percent
To make the changes persist, add
zswap.compressor=zstd zswap.max_pool_percent=10 to your bootloader's kernel command line options
For SSDs, set the
page-cluster value to 1 in
/etc/sysctl.d/99-cachyos-settings.conf. For HDDs, set it to 2.
A public speculative execution attack exploiting return instructions (retbleed) was revealed in July 2022. The kernel has fixed this, but it results in a significant performance overhead (14-39%).
The following CPU's are affected:
Check which mitigations your CPU is affected by:
grep . /sys/devices/system/cpu/vulnerabilities/*
While disabling the mitigations increases performance, it also introduces security risks.
Do so at your own risk.
Add the following to your kernel command line:
retbleed=off or to disable all mitigations:
Edit the appropriate file to persist the changes:
Note: Disabling these mitigations poses a security risk to your system.
For more information:
For improved performance and power efficiency, you can enable the AMD PSTATE EPP driver. The default AMD PSTATE driver may not provide the same benefits as the acpi-cpufreq driver.
Add one of the following options to your kernel command line:
You can switch between modes at runtime to test the options:
echo active | sudo tee /sys/devices/system/cpu/amd_pstate/status - Autonomous mode, platform considers only the values set for Minimum performance, Maximum performance, and Energy Performance Preference.
echo guided | sudo tee /sys/devices/system/cpu/amd_pstate/status - Guided-autonomous mode, platform sets operating performance level according to the current workload and within limits set by the OS through minimum and maximum performance registers.
echo passive | sudo tee /sys/devices/system/cpu/amd_pstate/status - Non-autonomous mode, platform gets desired performance level from OS directly through Desired Performance Register.
For more information:
To use the AMD PSTATE EPP, there are two CPU frequency scaling governors available: powersave and performance. It is recommended to use the powersave governor and set a preference.
sudo cpupower frequency-set -g powersave
sudo cpupower frequency-set -g performance
To set a preference, run the following command with the desired preference:
echo power | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference
Benchmarks for each preference can be found here:
In some cases, split lock mitigate can slow down performance in applications and games. A patch is available to disable it via sysctl.
sudo sysctl kernel.split_lock_mitigate=0
sudo sysctl kernel.split_lock_mitigate=1
To set the value permanently, add the following line to
For more information on split lock, see: