Skip to content

ly-dm as BG_CPUIO puts the whole desktop session in SCHED_IDLE #596

Closed

Description

@clalos

00-default/DEs-and-WMs/ly.rules has:

{ "name": "ly-dm", "type": "BG_CPUIO" }

BG_CPUIO includes "sched": "idle", "nice": 16 and "ioclass": "idle". All three are inherited across fork, and ly-dm is the parent of the whole graphical session, so every process started from the session inherits them.

On my machine (CachyOS, Ly + Xorg + i3):

1286 ly-dm   -> SCHED_IDLE, nice 16, ioclass idle
1664 ly-dm   -> SCHED_IDLE, nice 16, ioclass idle
1678 Xorg    -> SCHED_IDLE, nice -12
1697 i3      -> SCHED_IDLE, nice -12
1726 copyq   -> SCHED_IDLE, nice 16, ioclass idle
     firefox, slack, ghostty -> SCHED_IDLE

72 of about 290 processes were running SCHED_IDLE.

ananicy does still apply each app's own rule, so Xorg gets nice -12 from LowLatency_RT. But that rule sets no sched key, so the inherited SCHED_IDLE is never cleared, and Xorg ends up at nice -12 and SCHED_IDLE at the same time. A SCHED_IDLE task gets almost no CPU while any SCHED_OTHER task wants to run, so this hits the display server itself. Apps that have no rule of their own keep the full ly-dm penalty: nice 16, ioclass idle and SCHED_IDLE. copyq above is one of those.

Repro: log in through Ly, then run chrt -p $(pgrep -x Xorg).

Expected: only processes that are meant to be background run SCHED_IDLE. The display server, the window manager and normal apps run SCHED_OTHER.

sddm and greetd were changed to Launcher in #586. Some other session parents still use BG_CPUIO and look like the same case, though I have not tested them: lxdm-binary and lxdm-session in lxdm.rules, and gdm-wayland-session in gdm.rules.

Versions: cachyos-ananicy-rules 1:1.1.47-1, ananicy-cpp 1.2.0-1.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions