On my system, cgroup's directives doesn't work at all
Hi, I built ananicy-cpp with the latest commit which include cgroup (also with fix for #18 (closed) ) but for me, the cgroup directive doesn't take any effect.
I edit, for testing, the file /etc/ananicy.d/00-cgroups.cgroups as follow:
{ "cgroup": "cpu90", "CPUQuota": 90 }
{ "cgroup": "cpu80", "CPUQuota": 1 }
And so a game:
{ "name": "gta_sa.exe", "type": "Game", "cgroup": "cpu80" }
But when I execute the game, the CPU usage is not capped at all.
The verbose output is:
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.040] [debug] Found rule for gta_sa.exe: {"cgroup":"cpu80","ioclass":"realtime","name":"gta_sa.exe","nice":-15,"sched":"batch","type":"Game"}
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.040] [debug] Setting priority of gta_sa.exe(1184586) to -15
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.041] [warning] set_priority: Process not found: 1184586
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.549] [debug] Found rule for gta_sa.exe: {"cgroup":"cpu80","ioclass":"realtime","name":"gta_sa.exe","nice":-15,"sched":"batch","type":"Game"}
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.549] [debug] Setting priority of gta_sa.exe(1184587) to -15
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.550] [debug] set_priority: Successfully applied to 1184587
lug 21 13:02:55 hal9000 ananicy-cpp[1184022]: [2021-07-21 13:02:55.550] [debug] Setting scheduler of gta_sa.exe(1184587) to "batch"
All is properly set as I can see in ksysguard, except for the CPU usage which is not limited to 1 %.
Furthermore, the output of ananicy dump proc > ~/Desktop/dump.txt reports:
File: /etc/ananicy.d/00-cgroups.cgroups, Line: 6, Error: cgroup fs: cpu missing
File: /etc/ananicy.d/00-cgroups.cgroups, Line: 7, Error: cgroup fs: cpu missing
EDIT:
As I execute systemd-cgtop
, at least I can see that the groups which I made, exists on the system:
Edited by Dave