LP-first energy-aware sched_ext scheduler for Intel Arrow Lake
  • Rust 81.9%
  • C 17.9%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andrey Limachko b046e85533
1.3.0-alt1
- PPD-compatible D-Bus power profiles interface (org.freedesktop.UPower.PowerProfiles)
- Profile system with TOML config and embedded HW profiles
- One-shot CLI commands: apply, status, dump-config, list-profiles
- sysctl knob layer for sysfs/proc writes
- NAP cpuidle governor sysfs tuning
- Fix systemd Alias in [Install] section
- Fix fan: remove forced LOW fan speed when charging
- Respect D-Bus holds during AC/BAT switching
- Emit PropertiesChanged on AC/BAT switch
- Man page and documentation
2026-07-16 04:14:32 +04:00
.gear 1.3.0-alt1 2026-07-16 04:14:32 +04:00
.github/workflows ci(scx_arrow): add GitHub Actions workflow 2026-07-12 11:22:49 +04:00
dist fix: move systemd Alias from [Unit] to [Install] section 2026-07-16 02:14:18 +04:00
docs refactor: rename profiles and energy modes to PPD-compatible names 2026-07-16 01:49:55 +04:00
openspec chore: archive dbus-power-profiles change 2026-07-16 03:17:17 +04:00
src refactor: fix all clippy pedantic and nursery lints 2026-07-16 04:04:15 +04:00
vendor ALT: cargo vendor 2026-07-16 01:52:33 +04:00
.gitignore ALT: cargo vendor 2026-07-12 11:45:59 +04:00
AGENTS.md refactor: fix all clippy pedantic and nursery lints 2026-07-16 04:04:15 +04:00
build.rs build: reorganize into standalone single-crate layout 2026-07-12 09:16:51 +04:00
Cargo.lock 1.3.0-alt1 2026-07-16 04:14:32 +04:00
Cargo.toml 1.3.0-alt1 2026-07-16 04:14:32 +04:00
LICENSE build: switch to crates.io dependencies for standalone repo 2026-07-12 09:20:18 +04:00
README.md chore: fix verification issues — README D-Bus mention, vanishing client 2026-07-16 02:05:28 +04:00
rust-toolchain.toml build: switch to crates.io dependencies for standalone repo 2026-07-12 09:20:18 +04:00

scx-arrow

Energy-aware sched_ext scheduler and power manager for Intel Core Ultra 7 255H (Arrow Lake-H). Combines a 3-tier LP-first BPF scheduler with full system-wide power management — replaces TLP, thermald, power-profiles-daemon, irq-lp-cores, and art14-fan-daemon.

Fork origin

This project is a fork of Anton Palgunov's original project. It is now maintained by Andrey Limachko liannnix@altlinux.org.

Quick start

scx-arrow

That's it. All defaults are tuned for maximum energy efficiency on Arrow Lake-H. HFI, CPPC detection, AC/BAT power profiles, fan control, IRQ steering — all automatic.

Profiles and configuration

scx-arrow uses a profile system to manage all system settings. The daemon reads /etc/scx-arrow/config.toml at startup and applies settings from the selected power profile (power-saver, balanced, or performance).

The daemon exposes a D-Bus interface (org.freedesktop.UPower.PowerProfiles) compatible with GNOME Shell and other desktop environments, allowing profile switching from the quick settings panel.

Configuration file

# /etc/scx-arrow/config.toml
hw_profile = "honor-magicbook-art14-2025"

# Lock to a specific power profile (optional)
# profile = "power-saver"

[power_source_map]
bat = "power-saver"   # profile when on battery
ac  = "balanced"      # profile when on AC
  • hw_profile — hardware model (default: honor-magicbook-art14-2025)
  • profile — force a specific profile, ignoring AC/BAT switching. Use "auto" (or omit) for automatic switching via power_source_map
  • [power_source_map] — maps power source (bat/ac) to profile names

Profile management

scx-arrow profile list           # list available power profiles
scx-arrow profile show power-saver   # show all settings in a profile
scx-arrow profile apply power-saver  # apply profile system settings immediately

One-shot sysfs commands

Change any system knob without starting the daemon:

scx-arrow epp power
scx-arrow aspm powersupersave
scx-arrow pl1 15
scx-arrow bt block
scx-arrow wifi-pm on
scx-arrow intel-pstate passive
scx-arrow hwp-boost 0
scx-arrow sound-pm 1
scx-arrow nmi-watchdog 0
scx-arrow runtime-pm auto
scx-arrow usb-pm auto
scx-arrow dirty-wb 6000
scx-arrow nap-overshoot 360
scx-arrow irq-steer static 0-7

Hardware profiles

HW profile files define hardware-specific defaults and power profile values. Location search order:

  1. /etc/scx-arrow/profiles/<name>.toml
  2. /usr/share/scx-arrow/profiles/<name>.toml
  3. Embedded (compiled-in)

Each HW profile contains three power profiles (power-saver, balanced, performance) with full system settings and a [scheduler] section with all BPF parameters. See dist/profiles/ for an example.

System status

scx-arrow status                 # one-shot snapshot
scx-arrow status --watch 2       # continuous update every 2s

Shows active profile, power source, all managed sysfs settings with expected vs actual comparison, CPU frequencies per tier, RAPL power, C-state residency, PMC package C-states, fan status, and more.

Architecture

┌──────────────────────────────────────────────────────────┐
│                    scx-arrow                              │
│                                                          │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────┐   │
│  │ BPF         │  │ Power        │  │ Fan control    │   │
│  │ scheduler   │  │ manager      │  │ (ACPI WTER)    │   │
│  │ (LP-first)  │  │ (AC/BAT)     │  │                │   │
│  └──────┬──────┘  └──────┬───────┘  └───────┬────────┘   │
│         │                │                  │            │
│  ┌──────▼──────┐  ┌──────▼───────┐  ┌──────▼────────┐    │
│  │ CPPC detect │  │ EPP/EPB/HWP  │  │ EC temp/fan   │    │
│  │ 3-tier map  │  │ PL1/RAPL     │  │ 58°C off      │    │
│  │ LP→E→P      │  │ ASPM/PM      │  │ 62°C low(24%) │    │
│  │ procdb      │  │ WiFi/BT      │  │ charge>2.5A   │    │
│  └─────────────┘  │ VM dirty     │  │ → auto        │    │
│                   │ IRQ steering │  └───────────────┘    │
│                   └──────────────┘                       │
└──────────────────────────────────────────────────────────┘

Core tiers

Tier Microarch Tile Role CPPC Max freq
LP E-cores Crestmont SoC idle/background, Compute OFF 25 700 MHz
E-cores Skymont Compute general-purpose 62 1.8 GHz
P-cores Lion Cove Compute interactive / heavy 82 3.1 GHz

Detection: CPPC highest_perf (primary) → cpuinfo_max_freq → HFI → CoreType. HFI auto-detected (skipped if sysfs absent).

Scheduler policy

  • New tasks start on LP E-cores (earn your tier)
  • Bursts over thresholds escalate LP→E→P
  • Quiet tasks drain back to lower tiers
  • LP-only mode disabled by default (lp_only_load_pct=0): E-cores handle general-purpose workloads more efficiently due to L3 cache and race-to-idle
  • strict_lp=false: LP-tier tasks can spill to E/P when LP DSQ is congested
  • Rate-limited update_lp_only_state() (2ms)

Measured: LP per-core load -82%, battery power -12% vs previous LP-only defaults (lp_only_load_pct=60, burst_up_streak=7, strict_lp=true).

Power management (replaces TLP)

AC/BAT switching

Automatically detected via BAT0/status. On transition, switches the active power profile according to [power_source_map] in /etc/scx-arrow/config.toml (default: bat=power-saver, ac=balanced). Each profile applies ALL system settings atomically — EPP/EPB, PL1, ASPM, WiFi, Bluetooth, etc.

Setting Balanced (AC) Economy (BAT)
EPP balance_power power
EPB 8 12
HWP dynamic boost 1 0
RAPL PL1 28W 15W
PCIe ASPM default powersupersave
Runtime PM auto auto
WiFi power_save off on
Bluetooth unblock block
VM dirty writeback 15s 60s

Note: RAPL PL1 management is disabled by default (no_pl1 = true in profile). Set no_pl1 = false in the profile or pass --no-pl1=false to enable.

Startup (one-shot)

  • nmi_watchdog = 0
  • Sound power_save = 1s, controller = Y
  • USB autosuspend = auto (all devices)
  • PMC LTR ignore masks for S0ix (XHCI, ME, SOUTHPORT_C, platform aggregates)
  • EPP written directly (passive-mode trick off by default, see below)

EPP passive-mode trick

Direct EPP sysfs writes fail with EBUSY when HWP is in active mode. By default arrow does not work around this — failed EPP writes are logged and skipped, and intel_pstate/status is never touched. Enable the workaround with --pstate-switch=true: arrow reads the current intel_pstate/status, switches to passive, writes EPP, then restores the previously read value (so a system intentionally kept in passive stays in passive). The value persists because HWP hardware accepts the MSR update from passive mode.

Fan control (replaces art14-fan-daemon)

Controls HONOR MagicBook Art 14 fans via ACPI WTER calls to the EC.

Condition Action
Fan running, temp < 58°C, not charging OFF
Fan off/fast, 58°C ≤ temp < 62°C, not charging LOW (24%)
Temp ≥ 62°C or charging current > 2500mA AUTO
Charging (any temp) LOW minimum (never fully off)

Uses huawei_wmi hwmon for EC temperature and fan RPM. Thresholds ported verbatim from art14-fan-daemon.

IRQ steering (replaces irq-lp-cores.service)

At startup, scans PCI devices for i915/iwlwifi/xe drivers and sets their MSI IRQ affinity to E+LP cores, keeping P-cores free for deep C-states. NVMe excluded (kernel-managed, writes ignored).

Procdb

  • Path: ~/.config/scx-arrow/profiles.db
  • Per-process profiles with EWMA burst/sleep/wakeup metrics
  • Persisted every 30s and on exit
  • Warm-start classification on next boot

CLI options

All defaults are tuned for Arrow Lake-H 255H. CLI flags override profile values.

Daemon control

--profile <NAME>       Lock to a specific power profile (ignores power_source_map)
--hw <NAME>            Override hardware profile name

Scheduler

-s, --slice-us <US>              Time slice (default: 2000)
-b, --lp-burst-ms <MS>           LP→E threshold (default: 80)
-B, --e-burst-ms <MS>            E→P threshold (default: 500)
-d, --drain-delay-ms <MS>        Drain-back delay (default: 5000)
-i, --interactive-wakeup-freq <N> Interactive wakeup threshold (default: 30)
--lp-only-load-pct <PCT>         LP-only load threshold (default: 0 = disabled)
--lp-only-hyst-pct <PCT>         LP-only hysteresis (default: 0)
--burst-up-streak <N>            Consecutive bursts required (default: 3)
--fast-burst-ms <MS>             Fast-burst window (default: 100)
--interactive-short-burst-us <US> Short burst threshold (default: 50)
--interactive-csw-rate <RATE>    Ctx switch rate (default: 20)
--strict-lp <true|false>         Prevent LP tasks on E/P (default: false)
--lp-can-help-e <true|false>     LP helps E when idle (default: false)

Power management

--pl1-battery-w <W>              PL1 on battery (default: 15)
--pl1-ac-w <W>                   PL1 on AC (default: 28)
--hwp-boost-ac <0|1>             HWP dynamic boost on AC (default: 1)
--hwp-boost-bat <0|1>            HWP dynamic boost on battery (default: 0)
--aspm-ac <POLICY>               PCIe ASPM on AC (default: default)
--aspm-bat <POLICY>              PCIe ASPM on battery (default: powersupersave)
--runtime-pm-ac <on|auto>        Runtime PM on AC (default: auto)
--runtime-pm-bat <on|auto>       Runtime PM on battery (default: auto)
--wifi-pwr-ac <on|off>           WiFi power_save on AC (default: off)
--wifi-pwr-bat <on|off>          WiFi power_save on battery (default: on)
--bluetooth-ac <unblock|block>   Bluetooth on AC (default: unblock)
--bluetooth-bat <unblock|block>  Bluetooth on battery (default: block)
--dirty-writeback-ac <CS>        VM dirty on AC (default: 1500)
--dirty-writeback-bat <CS>       VM dirty on battery (default: 6000)
--sound-power-save <S>           Sound autosuspend (default: 1)
--nmi-watchdog <0|1>             NMI watchdog (default: 0)
--usb-autosuspend <on|auto>      USB autosuspend (default: auto)
--ltr-ignore <true|false>        PMC LTR ignore for S0ix (default: true)
--ltr-ignore-indices <I,I,...>   PMC LTR indices (default: 4,6,8,26,27,52,53)

EPP/EPB per mode

--pstate-switch <true|false>     Enable intel_pstate switching fallback (default: false)
--epp-mode <dynamic|static>      EPP mode: dynamic (objective-driven) or static (default: static)
--epp-power-saver <VALUE>          EPP Power Saver (default: power)
--epp-balanced <VALUE>             EPP Balanced (default: balance_power)
--epp-performance <VALUE>          EPP Performance (default: balance_performance)
--epb-power-saver <VALUE>          EPB Power Saver (default: 12)
--epb-balanced <VALUE>             EPB Balanced (default: 8)
--epb-performance <VALUE>          EPB Performance (default: 4)

Fan control

--fan-control <true|false>       Enable fan control (default: true)
--fan-temp-off <°C>              Fan OFF threshold (default: 58)
--fan-temp-low <°C>              Fan LOW threshold (default: 62)
--fan-low-pct <0-100>            Fan LOW speed (default: 24)
--fan-charge-threshold <MA>      Charge current for fan AUTO (default: 2500)

Detection and IRQ

--no-hfi                         Disable HFI (auto-detected)
--hfi-poll-ms <MS>               HFI polling (default: 0 = auto)
--irq-policy <off|static>        IRQ steering (default: static)

Disabling subsystems

Every power-management subsystem can be disabled individually with a --no-* flag. When a subsystem is disabled, arrow never touches it — it does not read, write, or restore the corresponding sysfs knobs.

--no-pl1 [<true|false>]          RAPL PL1 (default: true = disabled)
--no-epp                         Disable EPP writes
--no-epb                         Disable EPB writes
--no-hwp-boost                   Disable HWP dynamic boost management
--no-aspm                        Disable PCIe ASPM policy management
--no-runtime-pm                  Disable PCI Runtime PM management
--no-wifi-pm                     Disable WiFi power_save management
--no-bluetooth                   Disable Bluetooth rfkill management
--no-dirty-writeback             Disable VM dirty writeback tuning
--no-sound-pm                    Disable sound card power_save at startup
--no-nmi-watchdog                Disable NMI watchdog tuning at startup
--no-usb-autosuspend             Disable USB autosuspend tuning at startup

Overrides

--interactive-comm <COMMS>       Force P-tier compositors
                                 (default: kwin_wayland,gnome-shell,Hyprland,sway,niri,picom)
--no-lp-comm <COMMS>             Force min E-tier
--background-cgroup <PATHS>      Force LP-tier cgroups

Stats

--stats <SECONDS>                Stats interval
--monitor <SECONDS>              Monitor-only mode
-D, --debug                      BPF debug output
-v, --verbose                    Verbose logging
-V, --version                    Version

Services replaced

Component Replaced by
TLP + tlp-pd arrow power manager
thermald arrow fan control + PL1
power-profiles-daemon arrow profiles + AC/BAT
irq-lp-cores.service arrow IRQ steering
art14-fan-daemon arrow FanManager
s0ix-ltr-ignore.service arrow LTR ignore (startup)

Not replaced: upowerd (D-Bus API for desktop environments — do not disable).

Installation (ALT Linux)

sudo apt-get install scx-arrow
sudo systemctl enable --now scx-arrow

The package conflicts with tlp, thermald, and power-profiles-daemon — uninstall them first.

Manual build

cargo build --release
sudo cp target/release/scx-arrow /usr/bin/
sudo cp dist/scx-arrow.service /lib/systemd/system/
sudo mkdir -p /etc/scx-arrow/profiles
sudo cp dist/config.toml /etc/scx-arrow/
sudo cp dist/profiles/* /etc/scx-arrow/profiles/
sudo systemctl daemon-reload
sudo systemctl enable --now scx-arrow

Русский

Энергоэффективный sched_ext планировщик и менеджер питания для Intel Core Ultra 7 255H (Arrow Lake-H). Объединяет 3-уровневый LP-first BPF планировщик с полным управлением питанием системы — заменяет TLP, thermald, power-profiles-daemon, irq-lp-cores и art14-fan-daemon.

Профили и конфигурация

Система профилей позволяет управлять всеми настройками через конфигурационный файл /etc/scx-arrow/config.toml. Демон при старте загружает конфиг и применяет выбранный профиль энергопотребления (power-saver/balanced/performance).

# /etc/scx-arrow/config.toml
hw_profile = "honor-magicbook-art14-2025"

[power_source_map]
bat = "power-saver"   # профиль при работе от батареи
ac  = "balanced"      # профиль при работе от сети

Автоматическое переключение при смене источника питания. Можно зафиксировать профиль: profile = "power-saver" — демон игнорирует AC/BAT.

Команды управления

scx-arrow profile list          # список профилей
scx-arrow profile show power-saver  # все настройки профиля
scx-arrow profile apply power-saver # применить системные настройки
scx-arrow epp power             # one-shot установка EPP
scx-arrow aspm powersupersave   # one-shot установка ASPM
scx-arrow status                # состояние системы