scx-upstream/services
Andrea Righi 678b10133d scheds: introduce scx_flash
Introduce scx_flash (Fair Latency-Aware ScHeduler), a scheduler that
focuses on ensuring fairness among tasks and performance predictability.

This scheduler is introduced as a replacement of the "lowlatency" mode
in scx_bpfland, that has been dropped in commit 78101e4 ("scx_bpfland:
drop lowlatency mode and the priority DSQ").

scx_flash operates based on an EDF (Earliest Deadline First) policy,
where each task is assigned a latency weight. This weight is adjusted
dynamically, influenced by the task's static weight and how often it
releases the CPU before its full assigned time slice is used: tasks that
release the CPU early receive a higher latency weight, granting them
a higher priority over tasks that fully use their time slice.

The combination of dynamic latency weights and EDF scheduling ensures
responsive and stable performance, even in overcommitted systems, making
the scheduler particularly well-suited for latency-sensitive workloads,
such as multimedia or real-time audio processing.

Tested-by: Peter Jung <ptr1337@cachyos.org>
Tested-by: Piotr Gorski <piotrgorski@cachyos.org>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
2024-11-16 14:49:25 +01:00
..
openrc openrc: drop separate logs 2024-09-05 18:19:01 +02:00
systemd scx_loader: Add systemd service and on-DBUS launch 2024-09-27 23:51:28 +04:00
README.md Update README.md 2024-08-30 18:54:52 +02:00
scx scheds: introduce scx_flash 2024-11-16 14:49:25 +01:00

A Quick Start Guide

This guide provides instructions for running the SCX schedulers as a systemd service and checking its logs.

Getting Started

At the very beginning, configure the /etc/default/scx file:

  • in the SCX_SCHEDULER variable, select the scheduler you are interested in

  • in the SCX_FLAGS variable, specify the flags you want to add. To do this, execute and read what flags you can add.

scx_SCHEDNAME --help

To start the SCX scheduler at boot, you need to run the systemd service as root. Here are the steps:

  • Enable the service:
systemctl enable scx.service
  • Start the service:
systemctl start scx.service

Alternatively, you can use a shortened version of these commands:

systemctl enable --now scx.service
  • To check the status of the service, use the following command:
systemctl status scx.service

Override global configuration

It is possible to override the global scx settings using systemd environment variables SCX_SCHEDULER_OVERRIDE and SCX_FLAGS_OVERRIDE.

Example:

systemctl set-environment SCX_SCHEDULER_OVERRIDE=scx_rustland
systemctl set-environment SCX_FLAGS_OVERRIDE="-s 10000"
systemctl restart scx

If you want to restore the default value from the /etc/default/scx file execute:

systemctl unset-environment SCX_SCHEDULER_OVERRIDE
systemctl unset-environment SCX_FLAGS_OVERRIDE
systemctl restart scx

Checking journald Logs

  • To view the logs, use the following command:
journalctl -u scx.service
  • To view the logs of the current session use the command
journalctl -u scx.service -b 0