Closed sirlucjan closed 2 months ago
I got a report that on the existing systemd files everything works if scx-scheds-git is used.
I managed to figure everything out and found that: systemctl daemon-reload sometimes does not remove symlinks from /etc/systemd/system/*targets and then you need full disable and enable. Ive changed WantedBy=multi-user.target into WantedBy=graphical.target some time ago https://github.com/sched-ext/scx/pull/332 but it didn't work even with reboot! To change target I HAVE to disable service and enable it again. And only then new symlink was created. For this reason, PR is drafted so far. We need to make sure we need it.
systemctl reenable scx
will cause that no matter what change we make to the systemd service, it will always work. Unfortunately, systemctl daemon-reload
does not move symlinks between targets, so users who already had this installed will still have to make systemctl enable scx
manually (without this commit).
(2/3) Arming ConditionNeedsUpdate...
(3/3) Checking scx_scheduler...
The service is active. Restarting...
Removed '/etc/systemd/system/graphical.target.wants/scx.service'.
Created symlink '/etc/systemd/system/graphical.target.wants/scx.service' → '/usr/lib/systemd/system/scx.service'.
Service has been restarted.
'makepkg -srdi --sign' time: 52:43,17s, cpu: 303%
lucjan at cachyos ~/Pobrane/scx-scheds-git 23:44:20
❯ systemctl status scx
● scx.service - Start scx_scheduler
Loaded: loaded (/usr/lib/systemd/system/scx.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-07-03 23:44:20 CEST; 15s ago
Invocation: 5a3ecc59673b424ca3968a65fbcddf9e
Main PID: 57401 (scx_bpfland)
Tasks: 2 (limit: 37758)
Memory: 6.9M (peak: 17.6M)
CPU: 81ms
CGroup: /system.slice/scx.service
└─57401 scx_bpfland
lip 03 23:44:26 cachyos bash[57401]: 21:44:26 [INFO] running: 1 | unbound: 1 | direct: 3850 | prio: 680 | shared: 607
lip 03 23:44:27 cachyos bash[57401]: 21:44:27 [INFO] running: 1 | unbound: 1 | direct: 4339 | prio: 789 | shared: 632
lip 03 23:44:28 cachyos bash[57401]: 21:44:28 [INFO] running: 1 | unbound: 1 | direct: 4564 | prio: 802 | shared: 645
lip 03 23:44:29 cachyos bash[57401]: 21:44:29 [INFO] running: 1 | unbound: 1 | direct: 4764 | prio: 813 | shared: 655
lip 03 23:44:30 cachyos bash[57401]: 21:44:30 [INFO] running: 1 | unbound: 1 | direct: 4989 | prio: 826 | shared: 670
lip 03 23:44:31 cachyos bash[57401]: 21:44:31 [INFO] running: 1 | unbound: 1 | direct: 5234 | prio: 843 | shared: 679
lip 03 23:44:32 cachyos bash[57401]: 21:44:32 [INFO] running: 1 | unbound: 1 | direct: 5453 | prio: 860 | shared: 691
lip 03 23:44:33 cachyos bash[57401]: 21:44:33 [INFO] running: 1 | unbound: 1 | direct: 7574 | prio: 927 | shared: 912
lip 03 23:44:34 cachyos bash[57401]: 21:44:34 [INFO] running: 1 | unbound: 1 | direct: 7884 | prio: 971 | shared: 934
lip 03 23:44:35 cachyos bash[57401]: 21:44:35 [INFO] running: 1 | unbound: 1 | direct: 8121 | prio: 988 | shared: 947
Sources:
https://serverfault.com/questions/700862/do-systemd-unit-files-have-to-be-reloaded-when-modified
It seems that for the time being there is no need to change: https://github.com/sched-ext/scx/issues/354#issuecomment-2220245447 However, if necessary, I will return to test.
The second approach to change the policy of launching the systemd service.
The first approach was not successful, but nevertheless the problem with too early loading of the service remained. This time we managed to achieve a working result.
Potential issues
This solution has drawbacks. Simply reloading the service with
systemctl daemon-reload
or even reboot MAY be not enough. For some users it is required to executesystemctl disable --now scx.service
andsystemctl enable --now scx.service
.I realize that this is not a good solution, but at the moment I am unable to think of anything else. Feel free to discuss