From 0cc710f9978c3def19f0f89ae88fca4c2e3eb3db Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Sun, 6 Sep 2026 22:51:29 +0200 Subject: [PATCH] Feature: sched-ext Gaming-Scheduler (scx_lavd) aktiviert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Installiert scx-scheds aus dem bereits konfigurierten XanMod-Repository und aktiviert den für Gaming/interaktive Desktop-Workloads gebauten Latency-criticality Aware Virtual Deadline Scheduler im Autopilot-Modus. Benötigt einen Kernel mit CONFIG_SCHED_CLASS_EXT (bei XanMod bereits aktiv); nach frischer Kernel-Installation ggf. Neustart nötig. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017WMUd2fGsPCtTCVQkSS5TA --- AGENTS.md | 2 +- README.md | 3 +++ stages/06-services.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 5543494..1a22e92 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,7 +44,7 @@ Dieses Repository ist ein modulares, automatisiertes Setup- und Konfigurations-F │ ├── 03-bootloader.sh # GRUB Kernel-Parameter, Vimix-Theme, Plymouth Solar │ ├── 04-packages.sh # Installation der thematischen Paketlisten │ ├── 05-fonts.sh # Download & Installation von Coding- & Nerd-Fonts -│ ├── 06-services.sh # Aktivierung von AppArmor, Docker, Libvirt, zram, Ollama, GameMode/CoreCtrl, systemd-oomd +│ ├── 06-services.sh # Aktivierung von AppArmor, Docker, Libvirt, zram, Ollama, GameMode/CoreCtrl, systemd-oomd, scx-Scheduler │ ├── 07-skel-and-user.sh # /etc/skel Vorlagen, ZSH-Shell-Setzen, Dotfiles-Sync │ ├── 08-flatpaks.sh # Flathub Setup, Flatpak-Paketlisten-Installation │ ├── 09-apps.sh # Spotify, Waydroid, OpenDeck, Desktop-Starter, MIME-Types diff --git a/README.md b/README.md index 9417e9d..6c74dfa 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,9 @@ Installiere nur bestimmte Phasen (z. B. nur Paketlisten und Schriften): ### systemd-oomd (Out-of-Memory-Schutz) - Wird aktiviert, um Einfrieren des Systems bei gleichzeitiger Speicher-/Swap-Auslastung (Spiel + Discord + Browser) zu verhindern – ergänzt das bestehende zram-Swap. +### Sched-ext Gaming-Scheduler +- **sched-ext (`scx-scheds`)**: `stages/06-services.sh` installiert das Paket aus dem bereits konfigurierten XanMod-Repository und aktiviert den Scheduler `scx_lavd` (Latency-criticality Aware Virtual Deadline – speziell für Gaming/interaktive Desktop-Workloads) im `--autopilot`-Modus über `/etc/default/scx` und `scx.service`. Benötigt einen Kernel mit `CONFIG_SCHED_CLASS_EXT` (bei XanMod bereits aktiv); nach einer frischen Kernel-Installation ist ggf. ein Neustart nötig. + ### CPU P-State & Kernel-Parameter In `stages/03-bootloader.sh` wird der CPU-Hersteller automatisch ermittelt und in `/etc/default/grub` eingetragen: - **AMD CPUs**: `amd_pstate=active` diff --git a/stages/06-services.sh b/stages/06-services.sh index 89add4a..312798d 100755 --- a/stages/06-services.sh +++ b/stages/06-services.sh @@ -197,4 +197,31 @@ if command_exists systemctl; then log_success "systemd-oomd enabled (protects against freezes under heavy memory/swap pressure)." fi +# 11. Sched-ext (scx) Gaming Scheduler +log_substep "Configuring sched-ext (scx) gaming scheduler..." +apt_ensure_keyrings_dir +apt_add_keyring_from_url "https://dl.xanmod.org/archive.key" "xanmod-archive-keyring.gpg" || true +if [[ -f "$SCRIPT_DIR/data/apt/sources.list.d/xanmod.sources" ]]; then + apt_install_sources_file "$SCRIPT_DIR/data/apt/sources.list.d/xanmod.sources" "xanmod.sources" +fi +apt_update +if DEBIAN_FRONTEND=noninteractive apt-get install -y scx-scheds 2>/dev/null; then + if [[ -f /etc/default/scx ]]; then + # scx_lavd (Latency-criticality Aware Virtual Deadline) is purpose-built + # for gaming/interactive desktop workloads; --autopilot lets it balance + # performance vs. powersave automatically based on system load. + sed -i 's|^SCX_SCHEDULER=.*|SCX_SCHEDULER=scx_lavd|' /etc/default/scx + grep -q '^SCX_SCHEDULER=' /etc/default/scx || echo "SCX_SCHEDULER=scx_lavd" >> /etc/default/scx + sed -i "s|^#\?SCX_FLAGS=.*|SCX_FLAGS='--autopilot'|" /etc/default/scx + grep -q '^SCX_FLAGS=' /etc/default/scx || echo "SCX_FLAGS='--autopilot'" >> /etc/default/scx + fi + if command_exists systemctl; then + systemctl daemon-reload 2>/dev/null || true + systemctl enable --now scx.service 2>/dev/null || log_warn "scx.service could not be started - a reboot into a sched_ext-capable kernel (e.g. XanMod) may be required." + fi + log_success "sched-ext gaming scheduler (scx_lavd) configured and enabled." +else + log_warn "Could not install scx-scheds. Skipping sched-ext scheduler configuration." +fi + log_success "Stage 06: System services configuration completed successfully!"