[Bug Report] plasma-foreground-booster — "Can't open dmem" errors

Environment:

  • CachyOS (latest)
  • KDE Plasma
  • systemd 260
  • Kernel: CONFIG_CGROUP_DMEM=y

Package Version:
plasma-foreground-booster 0.0.dmemcg.experimental-3

Issue Description:
The plasma-foreground-booster service fails to start and logs errors when attempting to use the dmem cgroup controller:

Can't open dmem
Writing dmem limit

Steps to Reproduce:

  1. Install plasma-foreground-booster from CachyOS repositories
  2. Reboot or start the service manually: systemctl start plasma-foreground-booster
  3. Check status: systemctl status plasma-foreground-booster — shows failed state
  4. Check logs: journalctl -u plasma-foreground-booster — shows “Can’t open dmem” errors

Root Cause Analysis:

  • The dmem controller exists at the root cgroup level (/sys/fs/cgroup/cgroup.controllers shows dmem)
  • However, it is not propagated to user slicesuser@1000.service only has: cpuset cpu io memory pids
  • Even though the kernel has CONFIG_CGROUP_DMEM=y and systemd 260 has partial dmem support, the dmem controller is not automatically enabled for user session cgroups
  • The foreground_booster tries to use dmem without checking availability, causing it to fail

Relevant Context:

  • systemd PR #37079 (draft) adds native dmem support to systemd with DeviceMemoryLow/DeviceMemoryMax settings, but is not yet merged
  • The CachyOS package appears to be ahead of upstream infrastructure
  • The KDE Plasma kcgroups library (libKF5CGroups.so) contains dmem error strings but doesn’t gracefully handle missing dmem

Expected Behavior:
The service should either:

  1. Start successfully with dmem protection enabled, OR
  2. Handle missing dmem gracefully (degrade to no-op instead of failing)

Proposed Fix:
Check for dmem controller availability before attempting to use it — either skip dmem configuration with a warning, or fail gracefully with a clear message indicating dmem is not available in the current cgroup hierarchy.