From b8fb241e84fdf7cf4fae6f300a88fa3767dbadce Mon Sep 17 00:00:00 2001 From: Bastian de Byl Date: Sun, 4 Jan 2026 14:47:31 -0500 Subject: [PATCH] chore: updated guide with more custom nice rules --- content/post/kde-plasma-performance.md | 49 ++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/content/post/kde-plasma-performance.md b/content/post/kde-plasma-performance.md index 1b860d8..b402a5f 100644 --- a/content/post/kde-plasma-performance.md +++ b/content/post/kde-plasma-performance.md @@ -195,7 +195,8 @@ yay -S cachyos-ananicy-rules-git # Community rules sudo systemctl enable --now ananicy-cpp ``` -Now add custom rules for package management and compilation: +Now add custom rules. First, demote background tasks that shouldn't freeze your +desktop: ```bash sudo tee /etc/ananicy.d/package-managers.rules << 'EOF' @@ -212,12 +213,40 @@ sudo tee /etc/ananicy.d/package-managers.rules << 'EOF' {"name": "cargo", "type": "BG_CPUIO"} {"name": "ninja", "type": "BG_CPUIO"} {"name": "make", "type": "BG_CPUIO"} + +# Coredump processing - can churn through 100MB+ dumps +{"name": "systemd-coredump", "type": "BG_CPUIO"} +{"name": "coredumpctl", "type": "BG_CPUIO"} EOF ``` The `BG_CPUIO` type sets `nice=16`, `ioclass=idle`, and `sched=idle`. These processes will only get CPU and disk time when nothing else needs it. +Next, boost interactive desktop applications that need to stay responsive: + +```bash +sudo tee /etc/ananicy.d/99-desktop-priority.rules << 'EOF' +# Desktop apps that need high priority for responsiveness + +# Terminal emulators +{"name": "warp", "type": "LowLatency_RT"} +{"name": "kitty", "type": "LowLatency_RT"} +{"name": "alacritty", "type": "LowLatency_RT"} + +# Plasma desktop - boost higher than defaults +{"name": "plasmashell", "nice": -5, "ioclass": "best-effort", "ionice": 0, "latency_nice": -5} + +# Browsers - boost for snappier UI +{"name": "vivaldi-bin", "nice": -3, "ioclass": "best-effort", "ionice": 2, "latency_nice": -3} +{"name": "firefox", "nice": -3, "ioclass": "best-effort", "ionice": 2, "latency_nice": -3} +EOF +``` + +The `LowLatency_RT` type sets `nice=-12` — these apps get CPU priority over +almost everything else. The `99-` prefix ensures this file loads last and +overrides any conflicting defaults. + ## Step 5: Tune VM Dirty Page Handling The kernel's default dirty page settings are tuned for servers, not desktops. @@ -259,10 +288,24 @@ sudo sysctl --system | 1.2GB ClamAV RAM usage | 0 bytes | | BFQ overhead on NVMe | Direct hardware scheduling | | Compilation starves desktop | Compilation yields to UI | +| Coredump processing freezes system | Runs at idle priority | +| All processes equal priority | Desktop apps prioritized | + +The final priority hierarchy looks like this: + +| Process | Nice | Notes | +|:--------|-----:|:------| +| warp, kitty, kwin | -12 | `LowLatency_RT` — always responsive | +| plasmashell | -5 | Boosted from default -1 | +| vivaldi, firefox | -3 | Snappier than default | +| _normal processes_ | 0 | Default | +| pacman, dkms, gcc | +16 | `BG_CPUIO` — idle only | +| systemd-coredump | +16 | Won't freeze on crash dumps | DKMS can now compile nvidia modules while I continue working. Package updates -run in the background without the mouse cursor freezing. The system finally -behaves like it should on modern hardware. +run in the background without the mouse cursor freezing. Even when an app +crashes and generates a 100MB+ coredump, the desktop stays smooth. The system +finally behaves like it should on modern hardware. # Diagnostic Commands