sched-ext / scx

sched_ext schedulers and tools
https://bit.ly/scx_slack
GNU General Public License v2.0
692 stars 48 forks source link

scx.service: allow overriding scx variables #356

Closed Pprighi closed 3 weeks ago

Pprighi commented 3 weeks ago

Switching the scheduler requires changing SCX_SCHEDULER (and potentially also SCX_FLAGS) in /etc/default/scx.

This patch allows overriding these settings using systemd environment variables SCX_SCHEDULER_OVERRIDE and SCX_FLAGS_OVERRIDE, without changing the default configuration.

Example:

grep SCX_SCHEDULER /etc/default/scx SCX_SCHEDULER=scx_rusty

sudo systemctl status scx ... Main PID: 8021 (scx_rusty) ...

sudo systemctl set-environment SCX_SCHEDULER_OVERRIDE=scx_rustland sudo systemctl restart scx sudo systemctl status scx ... Main PID: 4021 (scx_rustland) ...

This feature can be useful for quickly testing different schedulers and settings, without altering the global system configuration.