Commit Graph

48 Commits

Author SHA1 Message Date
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
Piotr Gorski
7efe286af0
scx: sync default flags with CachyOS Kernel Manager
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-11-04 11:03:16 +01:00
Vladislav Nepogodin
9b5e8da8e3
scx_loader: Add systemd service and on-DBUS launch
- add ability to start loader at system start as a service

- add ability to automatically launch on DBUS call whenever third-party
calls the interface

ref: "Example 7. DBus services" https://www.freedesktop.org/software/systemd/man/256/systemd.service.html
2024-09-27 23:51:28 +04:00
Andrea Righi
41856aa527
Merge pull request #617 from sirlucjan/bpfland-new-flags
scx-scheds: update bpflands suggested flags
2024-09-05 19:21:17 +02:00
Piotr Gorski
51f8c35841
openrc: drop separate logs
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-09-05 18:19:01 +02:00
Piotr Gorski
cde5a39ae0
scx-scheds: update bpflands suggested flags
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-09-05 15:06:21 +02:00
Piotr Gorski
e14dae7270
Update README.md
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-08-30 18:54:52 +02:00
Piotr Gorski
19657d4e0c
scx_stats: Drop sched-ext namespace
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-08-27 18:06:37 +02:00
Piotr Gorski
924156c398
scx-scheds: Update scx_bpfland suggested flags
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-08-23 21:23:20 +02:00
Piotr Gorski
3f0fcc319c
scx-scheds: set scx_bpfland as default scheduler
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-08-23 15:47:24 +02:00
Kawanaao
f35717e970
Create scx.logrotate 2024-08-20 18:02:15 +03:00
Kawanaao
3485adb47f
Add support for openrc logrotate 2024-08-20 17:47:16 +03:00
Peter Jung
9e2caa74c0
systemd: Drop temporarily disabled schedulers from service
Signed-off-by: Peter Jung <admin@ptr1337.dev>
2024-07-14 20:26:04 +02:00
Piotr Gorski
ee7c0cbea6
scheds: Add scx_bpfland scheduler to /etc/default/scx
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-28 22:01:24 +02:00
Piotr Gorski
1659152a62
Revert "Add After=graphical.target into service"
This reverts commit f7e575808b.

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-26 12:08:21 +02:00
Piotr Gorski
f7e575808b
Add After=graphical.target into service
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-25 11:05:37 +02:00
Piotr Gorski
0ace7226f0
README: Add information about restoring default values
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-14 21:24:56 +02:00
Pietro Righi
8da1b126f5 scx.service: document scx override variables
Add a small section to document how to use SCX_SCHEDULER_OVERRIDE and
SCX_FLAGS_OVERRIDE with the scx systemd service.

Also fix a small typo (namspace -> namespace).

Signed-off-by: Pietro Righi <pietro.righi.email@gmail.com>
2024-06-14 19:31:37 +02:00
Pietro Righi
66dea6262b scx.service: allow overriding scx variables
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.

Signed-off-by: Pietro Righi <pietro.righi.email@gmail.com>
2024-06-14 18:51:11 +02:00
Piotr Gorski
bbd3132b8e
scheds: Add scx_mitosis scheduler to /etc/default/scx
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-11 23:05:17 +02:00
Piotr Gorski
4558d5c3dd
scx: update /etc/default/scx sample flags
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-06 17:52:21 +02:00
Piotr Gorski
1505164ca0
scx.service: start service after graphical target
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-06-04 22:29:33 +02:00
Piotr Gorski
6c4101f30b
journal.conf: increase the size of the logs and drop unneeded options
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-05-15 21:35:13 +02:00
Peter Jung
cb8928260e
systemd-service: Don't restart always
Currently if the scx.service is failing to launch due issues, systemd will try to start the scheduler all the time.
This results into a massive flood to the kernel and does not bring the service up again.

explanation of the changes:
The StartLimitBurst=2 and StartLimitIntervalSec=30 settings tell systemd that if the service unsuccessfully tries to restart itself twice within 30 seconds, it should enter a failed state and no longer try to restart. This ensures that if the service is truly broken, systemd won't continuously try to restart it.

Signed-off-by: Peter Jung <admin@ptr1337.dev>
2024-05-09 14:54:07 +02:00
Piotr Gorski
ef60559cb5
systemd: Move services to separate directory
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-04-04 20:29:54 +02:00
Damian N.
2f998e2a2b
services/openrc: symlinking fix 2024-04-03 22:02:14 +02:00
Damian N.
33abc27183
openrc meson.build: symlinking 1st try 2024-04-03 21:21:26 +02:00
Damian N.
505f4c47a0
services/openrc: mesonfile 2024-04-03 19:57:32 +02:00
Damian N.
5163d8b441
deleted: services/scx.initrd 2024-04-03 19:47:41 +02:00
Damian N.
3e6bcab337
mv scx.initrd openrc/scx.initrd 2024-04-03 19:45:55 +02:00
Damian N.
e19bc1b62d
openrc init.d service file 2024-04-03 19:30:22 +02:00
Piotr Gorski
040ade57ef
scx: update /etc/default/scx
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-03-18 09:25:11 +01:00
Piotr Gorski
f87fe20de2
scx: update /etc/default/scx
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-02-28 18:59:55 +01:00
Piotr Gorski
22e775842a
Make meson.build more readable
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-29 17:14:39 +01:00
Piotr Gorski
561cbc4e6d
Update README.md
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-27 00:59:23 +01:00
Piotr Gorski
26d53233de
systemd-services: add one service for all schedulers and config file
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-27 00:41:00 +01:00
Piotr Gorski
23223b8b77
systemd-services: setting conflict between schedulers
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-26 22:18:51 +01:00
Piotr Gorski
128fa63cc2
systemd-services: replace ConditionPathExists with ConditionPathIsDirectory
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-25 15:12:15 +01:00
Piotr Gorski
db5d7c53d8
Update descriptions
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-24 16:35:47 +01:00
Piotr Gorski
25cc69b3c4
Add README.md for systemd services
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-24 14:56:45 +01:00
Piotr Gorski
9848ab4183
Increase log size to 25M
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-19 21:30:33 +01:00
Piotr Gorski
1a1290d54c
Simplify the location of the journal-sched-ext file
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-19 19:13:28 +01:00
Piotr Gorski
b6650fa4dc
Set the correct value for sched-ext journald namespace
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-19 18:22:47 +01:00
Piotr Gorski
8c61d38743
Drop unneeded default value
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-18 00:23:04 +01:00
Piotr Gorski
1abd319cae
Set log size to 10M
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-18 00:03:07 +01:00
Piotr Gorski
af1f344447
Allow to run from both /usr/sbin and /usr/bin
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-16 16:04:30 +01:00
Piotr Gorski
c7678eb0e9
Adapting service names to scheduler names
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-16 10:26:25 +01:00
Piotr Gorski
d618a06d92
Add systemd services for scx schedulers
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-01-15 23:41:59 +01:00