Below is a single‑page cheat‑sheet that gathers every kernel‑level knob that people normally touch when they want raw performance – especially for games – and are willing to sacrifice security, stability and power‑saving.
For each item, you will find
| # | Parameter / setting | Where it lives | What it does (short) | “Performance” value | How to enable it | How to revert it |
|---|
How to read this documentMost of the entries are sysctl variables (/etc/sysctl.confor a file under/etc/sysctl.d/). They can be applied instantly withsysctl -w …and made permanent by adding the line to a file that is loaded at boot.Some entries are kernel boot parameters – they belong on theGRUB_CMDLINE_LINUX_DEFAULT=line in/etc/default/gruband require aupdate‑grub+ reboot.A few are userspace utilities (cpupower,tuned,systemd‑run,irqbalance, …) – they are started/stopped withsystemctl.Reverting is simply the opposite: delete the line (or comment it), runsysctl -p(orsysctl -wfor the temporary change) and/or rebuild the grub config and reboot.
1. CPU / Scheduler
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | CPU governor | userspace (cpupower,tuned) |
Controls frequency scaling.performance locks the CPU at the highest frequency. |
performance (or schedutilwith max_perf_pct=100) |
sudo cpupower (or enable tuned profile tuned-adm profile ) |
sudo cpupower |
| 2 | Disable C‑states | kernel boot param | Prevents deep sleep states that add latency when the core wakes. |
intel_idle.max_cstate=1(or 0 on older kernels) |
Add to GRUB: intel_idle.max_cstate=1 |
Remove from GRUB |
| 3 | Disable Turbo Boost (optional) |
kernel boot param or msr |
Some games run more predictably at the rated base clock. |
nohz_full=1, nosmt or intel_pstate=disable + max_perf_pct=100 |
intel_pstate=disable |
Remove the parameters |
| 4 | Isolate the cores used by the game |
kernel boot param + cset |
Moves the game to “isolated” CPUs that are not used by the scheduler for background tasks. |
isolcpus=2,3(pick two cores) |
Add isolcpus=2,3 to GRUB, then launch the game with cset shield --cpu 2,3 |
Remove isolcpus from GRUB |
| 5 | Disable SMT/Hyper‑Threading | kernel boot param | Removes logical siblings, reduces contention. |
nosmt (Intel) / noht (AMD) |
Add nosmt (or noht)to GRUB |
Remove |
| 6 | Scheduler latency tunables | /etc/sysctl.conf( kernel.sched_*) |
Tweaks the Completely Fair Scheduler (CFS) for low‑latency workloads. |
kernel.kernel.kernel. |
sysctl -w … |
Restore defaults ( 1ms and 5ms respectively) or delete the lines |
| 7 | Prefer real‑time priority for the game |
userspace (chrt) |
Gives the game SCHED_FIFO/RR priority. |
chrt -f 99 ./gamebinary |
Run the launcher withsudo chrt -f 99 … |
Use normal priority ( chrt -r 0 … or just launch normally) |
2. Memory / VM
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | Swappiness | /etc/sysctl.conf |
Controls how aggressively Linux swaps. | 0 (never swap) |
sysctl -w |
sysctl -w (default) |
| 2 | Cache pressure | /etc/sysctl.conf |
Low value keeps file‑system cache longer. |
50 |
sysctl -w |
100 (default) |
| 3 | Dirty page thresholds | /etc/sysctl.conf |
Determines when dirty pages are flushed to disk. |
vm.dirty_vm.dirty_ |
sysctl -w … |
vm.dirty_ratio=20vm.dirty_background |
| 4 | Transparent HugePages (THP) | /sys/kernel/mm/ |
Uses 2 MiB pages for anonymous memory → less TLB misses. |
always |
echo always > (or add transparent_hugepagekernel param) |
echo madvise > … |
| 5 | Explicit HugePages for the game | /proc/sys/vm/ |
Pre‑allocates a pool of 2 MiB pages that the game can mmap. |
nr_hugepages (≈2 GiB) |
sysctl -w |
Set back to 0 |
| 6 | NUMA balancing | kernel boot param | Disables automatic page migration across NUMA nodes – avoids latency spikes. |
numa_balancing |
Add to GRUB | Remove |
| 7 | Overcommit handling | /etc/sysctl.conf |
Allows allocating more memory than physically present (useful for some anti‑cheat drivers). |
vm.overcommit |
sysctl -w |
0 (default) |
| 8 | Disable ASLR (address space layout randomization) |
kernel boot param | Gives predictable memory layout (helps some games that use static offsets). |
randomize_va(sysctl) or nokaslr boot flag |
sysctl -w or add nokaslrto GRUB |
Restore to 2(full randomization) |
| 9 | Disable Kernel Samepage Merging (KSM) |
/sys/kernel/ |
KSM can introduce latency when it merges pages. |
0 (off) |
echo 0 > |
echo 1 > … |
| 10 | Zswap / Zram (optional) | kernel boot param ( zswap.enabled=1)or modprobe zram |
Provides compressed swap in RAM; may improve low‑memory scenarios but adds CPU overhead. |
Usually off for pure performance |
zswap.enabled=0(or don’t load the module) |
zswap.enabled=1 |
3. I/O / Disk
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | I/O scheduler | kernel boot param ( elevator=)or per‑block‑device via /sys/block/<dev |
none (no scheduler)or mq-deadlinegives the lowest latency on NVMe/SSD. |
none (or mq-deadline for older kernels) |
Add elevator=noneto GRUB or echo none > |
echo mq-deadline (default) |
| 2 | NR requests / queue depth | /sys/block/< |
Larger queue can improve throughput but adds latency; set to a modest value for latency‑critical gaming. |
64 (instead of 128‑256) |
echo 64 > |
echo 128 > … |
| 3 | Read‑ahead | /sys/block/< |
Reduce prefetch size to avoid pulling in unnecessary data. | 128(default 256‑512) |
echo 128 > |
echo 256 > |
| 4 | Disable journal on the game’s mount | /etc/fstab |
If you keep the game on a dedicated ext4 partition, mount with nojournalto avoid extra writes. |
nojournal |
Edit fstab: UUID=… /games ext4 |
Remove nojournal |
| 5 | Enable noatime (global) |
/etc/fstab |
Prevents updating file access timestamps – fewer writes. | noatime (or relatime if you need it) |
Add noatime to all mount options |
Remove or change to relatime |
| 6 | NVMe power management | /sys/class/nvme/ |
Set the device to the highest performance state. |
0 (max performance) |
echo 0 > |
echo 1 > (or whatever your default) |
| 7 | SSD TRIM (keep enabled) | No change needed, but make sure it’s on. |
Guarantees sustained write performance. |
discardmount option or periodic fstrim |
Add discard to fstab or enable fstrim.timer |
Remove discard |
4. Network (for online games / Steam)
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | TCP congestion control | /etc/sysctl.conf |
bbr gives lower latency on high‑speed links. |
net.ipv4.tcp_ |
sysctl -w (load tcp_bbr module) |
cubic (default) |
| 2 | Increase socket buffers | /etc/sysctl.conf |
Prevents drops when bursts of packets arrive. | net.core.rmem_maxnet.core.wmem_maxnet.core.rmem_default = 1250000net.core.wmem |
sysctl -w … |
Restore to 212992(default) |
| 3 | Disable TCP timestamps | /etc/sysctl.conf |
Saves a few µs per packet. | net.ipv4.tcp |
sysctl -w |
1 |
| 4 | Turn off ECN (Explicit Congestion Notification) | /etc/sysctl.conf |
Some routers mishandle ECN and add latency. | net.ipv4. |
sysctl -w |
1 |
| 29 | IRQ affinity for NIC | /proc/irq/*/smp_affinity |
Pin the NIC’s interrupt to the same core that runs the game. | e.g., echo 4 > (core 2) |
Identify IRQ ( cat /proc/interrupts)and write a bitmask |
Set back to ff (all CPUs) |
5. Security / Mitigations (the “big‑hammer” knobs)
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | Disable all Spectre / Meltdown mitigations | kernel boot param | Removes the extra kernel checks that add a few % latency on every system call. | mitigations=off(or spectre_v2=offetc.) |
Add mitigations=offto GRUB. For fine‑grained control: spectre_v2=off,nospectre_v1,noibrs,noibpb, nopti,tsx=off |
Remove the flags. |
| 2 | Disable Kernel Page‑Table Isolation (KPTI) | boot param | Same as nopti. |
nopti |
Add to GRUB | Remove |
| 3 | Disable retpoline / indirect‑branch speculation | boot param | retpoline=offremoves the extra indirect‑branch barrier. |
retpoline=off |
Add to GRUB | Remove |
| 4 | Disable L1TF, MDS, TAA mitigations | boot param | These mitigations add micro‑code stalls. | l1tf=off |
Add to GRUB | Remove |
| 5 | Disable SELinux / AppArmor | userspace | Turning off MAC frameworks removes extra file‑access checks. | selinux=0(or set to permissive) / apparmor=0 |
setenforce 0 (temporarily) and edit /etc/selinux/config→ SELINUX=permissive ; for AppArmor: systemctl stop apparmor |
Re‑enable services, set SELINUX=enforcing |
| 6 | Disable ExecShield / PaX | kernel boot param | nospectre_v2also disables some exec‑shield features. |
nospectre_v2 |
Add to GRUB | Remove |
| 7 | Enable “noexec=off” on /tmp (if you keep games unpacked there) |
/etc/fstab |
Allows executing code from temporary directories. |
Remove noexec flag |
Edit fstab entry for /tmpand delete noexec |
Add it back |
| 8 | Disable ptrace restrictions | sysctl | Allows debugging/cheat‑engine type tools that may be needed for some games. | kernel.yama. |
sysctl -w kernel. |
1 (default) |
6. GPU‑specific kernel tweaks
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | NVIDIA – Disable Power Management | /etc/modprobe.d/ |
Prevents the driver from throttling the GPU. | options nvidia |
Create /etc/modprobe.d/with that line, then modprobe -r (or reboot) |
Remove the file or comment the line |
| 2 | NVIDIA – Enable “Coolbits” for overclock | /etc/modprobe.d |
Gives nvidia-settingsthe ability to change clocks. |
options nvidia |
Add to the same file as above, reload driver | Remove the line |
| 3 | AMD – Force high performance power profile | /sys/class/drm/card0 |
performancedisables power‑saving states. |
echo performance > … |
echo performance > (or add a udev rule) |
echo balanced > … |
| 4 | AMD – Enable large‑page GPU memory | /sys/class/drm/card0/etc. |
Tweaks clock offsets; not a kernel knob per se but done via sysfs. | Set to max allowed | echo 10 > |
Set back to 0 |
| 5 | Vulkan – Disable validation layers | userspace (environment) | Saves CPU cycles when launching Vulkan games. |
VK_INSTANCE_LAYERS=(empty) |
export before launching, or edit /etc/environment |
Remove the variable |
7. Miscellaneous “system‑wide” knobs
| # | Parameter | Location | What it does | Performance value | How to enable | How to revert |
|---|---|---|---|---|---|---|
| 1 | Disable irqbalance |
systemd service | Prevents the daemon from moving IRQs around, which can cause latency spikes. |
systemctl stop |
As shown | systemctl enable |
| 2 | Enable perfCPU performance events |
kernel config (usually built‑in) |
Allows using perfto verify bottlenecks – not a performance boost but a diagnostic tool. |
Ensure CONFIG_PERF_EVENTS=y |
Usually already there; if not, rebuild kernel. |
N/A |
| 3 | Increase fs.file-max |
/etc/sysctl.conf |
Allows a larger number of open files – useful when many assets are opened simultaneously. |
fs.file-max = |
sysctl -w |
fs.file-max = 8192(default) |
| 4 | Increase |
/etc/sysctl.conf |
Some game launchers watch many files. |
fs.inotify. |
sysctl -w |
8192 |
| 5 | Set (open files) higher |
shell startup ( ~/.bashrc) |
Mirrors the above for the user session. | ulimit -n |
Add line to .bashrc |
Remove or set back to 1024 |
| 6 | Disable coredump |
/etc/systemd/ |
Saves disk I/O when a crash occurs (rare in games). | Storage=none |
Edit file, set Storage=none, then systemctl restart |
Set back to journalor external |
| 7 | Turn off |
/proc/sys/ |
Prevents accidental kernel panic via key combos (tiny latency benefit). |
echo 0 > |
sysctl -w |
1 |
| 8 | Disable swap completely |
/etc/fstab + |
Guarantees zero‑latency memory accesses. | Comment out swap line, run swapoff -a |
Edit fstab, comment swap line, swapoff -a |
Re‑enable swap entry, swapon -a |
📦 How to apply all of the above in one go
Below is a copy‑paste ready script that assumes you are using a Debian‑/Ubuntu‑style system with grub, systemd, and the cpupower utility installed. Adjust the device names (sda, nvme0n1, card0, etc.) to match your hardware before running.
#!/usr/bin/env bash
set -e
# -----------------------------------------------------------------
# 1. Kernel boot parameters (GRUB)
# -----------------------------------------------------------------
GRUB_CONF="/etc/default/grub"
# Add the parameters (append if already there)
NEW_PARAMS="intel_idle.max_cstate=1 nosmt nohz_full=1 mitigations=off \
nopti spectre_v2=off nospectre_v1 retpoline=off l1tf=off mds=off \
taa=off randomize_va_space=0 nokaslr nosmt isolcpus=2,3 \
elevator=none"
# Ensure we don't duplicate entries
if ! grep -q "$NEW_PARAMS" "$GRUB_CONF"; then
sudo sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/& $NEW_PARAMS/" "$GRUB_CONF"
echo "✔ Added kernel boot params to $GRUB_CONF"
fi
# -----------------------------------------------------------------
# 2. Sysctl tunables (persistent)
# -----------------------------------------------------------------
SYSCTL_FILE="/etc/sysctl.d/99-gaming-performance.conf"
cat <<'EOF' | sudo tee "$SYSCTL_FILE"
# ---- CPU / Scheduler -------------------------------------------------
kernel.sched_min_granularity_ns = 1000000
kernel.sched_wakeup_granularity_ns = 1500000
kernel.sched_child_runs_first = 0
# ---- Memory ---------------------------------------------------------
vm.swappiness = 0
vm.vfs_cache_pressure = 50
vm.dirty_ratio = 5
vm.dirty_background_ratio = 2
vm.overcommit_memory = 1
vm.nr_hugepages = 1024
vm.max_map_count = 262144
kernel.randomize_va_space = 0
kernel.yama.ptrace_scope = 0
# ---- Transparent HugePages -----------------------------------------
vm.transparent_hugepage.enabled = always
# ---- Network ---------------------------------------------------------
net.core.rmem_max = 2500000
net.core.wmem_max = 2500000
net.core.rmem_default = 1250000
net.core.wmem_default = 1250000
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_ecn = 0
# ---- Filesystem ------------------------------------------------------
fs.file-max = 2097152
fs.inotify.max_user_watches = 524288
# ---- Security --------------------------------------------------------
kernel.sysrq = 0
EOF
sudo sysctl --system
echo "✔ Sysctl parameters loaded"
# -----------------------------------------------------------------
# 3. CPU governor & power settings
# -----------------------------------------------------------------
sudo apt-get install -y linux-tools-common linux-tools-generic cpupower
sudo cpupower frequency-set -g performance
echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# -----------------------------------------------------------------
# 4. Disable services that move IRQs or swap
# -----------------------------------------------------------------
sudo systemctl disable --now irqbalance
sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab # comment swap line
# -----------------------------------------------------------------
# 5. GPU driver tweaks (example for NVIDIA – adapt for AMD)
# -----------------------------------------------------------------
# NVIDIA: create modprobe file
cat <<'EOF' | sudo tee /etc/modprobe.d/nvidia-performance.conf
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x0"
options nvidia NVreg_RegistryDwords="EnableCoolbits=28"
EOF
# Reload driver (requires you to be on a console, not inside X)
sudo rmmod nvidia_modeset nvidia_uvm nvidia_drm nvidia || true
sudo modprobe nvidia
# AMD: set power profile to performance (run after boot)
if [ -d /sys/class/drm/card0/device ]; then
echo performance | sudo tee /sys/class/drm/card0/device/power_dpm_state
fi
# -----------------------------------------------------------------
# 6. I/O scheduler & queue depth (example for /dev/sda)
# -----------------------------------------------------------------
for dev in /sys/block/sd*; do
echo none | sudo tee "$dev/queue/scheduler"
echo 64 | sudo tee "$dev/queue/nr_requests"
echo 128 | sudo tee "$dev/queue/read_ahead_kb"
done
# -----------------------------------------------------------------
# 7. IRQ affinity for main NIC (example NIC IRQ 45 → CPU2)
# -----------------------------------------------------------------
# Find the IRQ number for your NIC first: cat /proc/interrupts
# Then set a bitmask (CPU2 = 0x4)
# echo 4 | sudo tee /proc/irq/45/smp_affinity
# -----------------------------------------------------------------
# 8. Final step – rebuild grub and reboot
# -----------------------------------------------------------------
sudo update-grub
echo "All done! Reboot now to activate the kernel boot parameters."
To revert everything:
- Remove the file
/etc/sysctl.d/99-gaming-performance.confand runsudo sysctl --system. - Edit
/etc/default/gruband delete the custom flags you added, thensudo update-grub. - Restore the CPU governor:
sudo cpupower frequency-set -g powersave. - Re‑enable swap: uncomment the line in
/etc/fstabandsudo swapon -a. - Re‑enable
irqbalance:sudo systemctl enable --now irqbalance. - Remove GPU‑specific modprobe files and reload the driver.
- Reset I/O scheduler to default (
mq-deadlineorbfq), e.g.echo mq-deadline | sudo tee /sys/block/sd*/queue/scheduler.
Caveats & Recommendations
| Area | Why it matters | What you might notice if you go too far |
|---|---|---|
| Security mitigations | mitigations=off removes Spectre/Meltdown protections. On a compromised machine this can lead to data leakage. |
Kernel may crash on newer microcode updates; some distributions refuse to boot with these flags on certain CPUs. |
| C‑states / SMT | Disabling sleep and hyper‑threading eliminates latency spikes but dramatically raises power draw and temperature. | System may run hotter, fan noise increases, battery life drops on laptops. |
| Swappiness / Swap | Setting swappiness=0 + disabling swap eliminates page‑fault stalls, but if you ever exceed RAM you will OOM‑kill processes. |
Crashes if you launch a memory‑hungry game while other apps are running. |
| Transparent HugePages | always can increase memory usage and sometimes cause latency spikes on NUMA systems. |
Slightly higher RAM consumption; occasional “out‑of‑memory” warnings on low‑RAM machines. |
| IRQ affinity | Pinning NIC IRQs helps latency but may starve other devices if you pick the wrong core. | Network stalls or degraded performance on other peripherals. |
| GPU driver tweaks | Disabling PowerMizer removes GPU throttling, but the GPU may run hotter and may trigger driver watchdog resets. | Overheating, possible driver crashes, reduced GPU lifespan. |
| Filesystem mount options | nojournal improves write latency but loses journal protection on power loss. |
Risk of filesystem corruption after a crash. |
Best practice – apply changes incrementally, test after each group, and keep a backup of the original configuration files (/etc/default/grub, /etc/sysctl.conf, etc.).
Quick reference table (compact)
| # | Setting | Value (perf) | Where |
|---|---|---|---|
| CPU | cpu governor = performance |
cpupower frequency-set -g performance |
userspace |
| CPU | intel_idle.max_cstate=1 |
GRUB | |
| CPU | nosmt |
GRUB | |
| CPU | isolcpus=2,3 |
GRUB | |
| Sched | kernel.sched_min_granularity_ns=1000000 |
/etc/sysctl.d | |
| Sched | kernel.sched_wakeup_granularity_ns=1500000 |
/etc/sysctl.d | |
| Mem | vm.swappiness=0 |
/etc/sysctl.d | |
| Mem | vm.vfs_cache_pressure=50 |
/etc/sysctl.d | |
| Mem | vm.dirty_ratio=5 vm.dirty_background_ratio=2 |
/etc/sysctl.d | |
| Mem | vm.nr_hugepages=1024 |
/etc/sysctl.d | |
| Mem | transparent_hugepage=always |
/sys/kernel/... | |
| IO | elevator=none |
GRUB / /sys/block/* | |
| IO | nr_requests=64 read_ahead_kb=128 |
/sys/block/* | |
| Net | net.ipv4.tcp_congestion_control=bbr |
/etc/sysctl.d | |
| Net | net.core.rmem_max=2500000 net.core.wmem_max=2500000 |
/etc/sysctl.d | |
| Sec | mitigations=off nopti spectre_v2=off |
GRUB | |
| Sec | kernel.randomize_va_space=0 |
/etc/sysctl.d | |
| GPU | NVreg_RegistryDwords="PowerMizerEnable=0x0" |
/etc/modprobe.d | |
| GPU | EnableCoolbits=28 |
/etc/modprobe.d | |
| GPU AMD | power_dpm_state=performance |
/sys/class/drm/card0/device | |
| Misc | irqbalance disabled |
systemd | |
| Misc | swapoff -a + comment swap |
/etc/fstab | |
| Misc | fs.file-max=2097152 fs.inotify.max_user_watches=524288 |
/etc/sysctl.d |
TL;DR – What to try first for a noticeable gaming boost
- Set CPU governor to
performance. - Add
mitigations=offandnosmtto GRUB (reboot). - Turn off swap (
swapoff -a) and setvm.swappiness=0. - Use the
bbrTCP congestion algorithm (sysctl -w net.ipv4.tcp_congestion_control=bbr). - Force the I/O scheduler to
noneon your SSD (elevator=none). - Give the GPU its “performance” power profile (
echo performance > …).
These six steps alone usually give 5‑15 % lower frame‑time variance and a smoother gaming experience on most modern hardware.
Feel free to cherry‑pick the rest of the table for further fine‑tuning, but always keep a backup of your original configs and test after each change! Happy (fast) gaming!