Cgroups are not being recognized
Short summary: Even though I'm running Arch-based Manjaro on kernel 5.18.3, Ananicy-cpp doesn't seem to properly recognize cgroups.
How to reproduce: On Manjaro installation I do:
Start with verbose output: sudo ananicy-cpp -v start
.
See these snippets:
[warning] cgroup2 at /sys/fs/cgroup/ananicy_test_cgroup2 doesn't have a cpu controller available, skipping
[warning] Cgroups are not available on this platform (or are not enabled)
[trace] set_cgroup_cpu_quota: Skipping because no cgroup available
Other system utilities seem to recognize cgroups, namely, I see stuff in systemd-cgls
and in systemd-cgtop
.
What version do you use: Ananicy-cpp: 1.0.0_rc6
Linux kernel: 5.18.3
Configuration:
ananicy.conf
:
## Ananicy 2.X configuration
# Ananicy run full system scan every "check_freq" seconds
# supported values 0.01..86400
# values which have sense: 1..60
check_freq=10
# Verbose msg: true/false
cgroup_load=true
type_load=true
rule_load=true
apply_nice=true
apply_ioclass=true
apply_ionice=true
apply_sched=true
apply_oom_score_adj=true
apply_cgroup=true
check_disks_schedulers=true
loglevel=trace
00-cgroups.cgroups
:
# Cgroups definitions
# Currently very simple, only for group CPU intensive tasks
# cpuquota same as systemd CPUQuota,
# only difference is - meaning of N% is all CPUs, not one core.
{ "cgroup": "cpu90", "CPUQuota": 90 }
{ "cgroup": "cpu80", "CPUQuota": 80 }
Additional details:
sudo ananicy-cpp -v start
output:
[2022-06-14 16:32:50.682] [info] Config apply_cgroup: true
[2022-06-14 16:32:50.682] [info] Config apply_ioclass: true
[2022-06-14 16:32:50.682] [info] Config check_freq: 10
[2022-06-14 16:32:50.682] [info] Config loglevel: info
[2022-06-14 16:32:50.682] [info] Config cgroup_realtime_workaround: true
[2022-06-14 16:32:50.682] [info] Config rule_load: true
[2022-06-14 16:32:50.682] [info] Config check_disks_schedulers: true
[2022-06-14 16:32:50.682] [info] Config type_load: true
[2022-06-14 16:32:50.682] [info] Config apply_oom_score_adj: true
[2022-06-14 16:32:50.682] [info] Config apply_ionice: true
[2022-06-14 16:32:50.682] [info] Config cgroup_load: true
[2022-06-14 16:32:50.682] [info] Config apply_sched: true
[2022-06-14 16:32:50.682] [info] Config apply_nice: true
[2022-06-14 16:32:50.682] [debug] value: m_value = N/A
Ananicy Cpp 1.0.0-rc6
[2022-06-14 16:32:50.682] [debug] Scanning directory /etc/ananicy.d
[2022-06-14 16:32:50.683] [debug] Scanning directory /etc/ananicy.d/00-default
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/VMs
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/torrent-clients
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/music-players
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/remote-desktops
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/compilers
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/browsers
[2022-06-14 16:32:50.685] [debug] Scanning directory /etc/ananicy.d/00-default/games
[2022-06-14 16:32:50.686] [debug] Scanning directory /etc/ananicy.d/00-default/depricated-Heavy_CPU
[2022-06-14 16:32:50.686] [debug] Scanning directory /etc/ananicy.d/00-default/screenshotters
[2022-06-14 16:32:50.686] [debug] Scanning directory /etc/ananicy.d/00-default/databases
[2022-06-14 16:32:50.686] [debug] Scanning directory /etc/ananicy.d/00-default/chat
[2022-06-14 16:32:50.686] [debug] Scanning directory /etc/ananicy.d/00-default/terminals
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/image-viewers
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/DEs-and-WMs
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/servers
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/package-managers
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/VPNs
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/text-editors
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/archivers
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/services
[2022-06-14 16:32:50.687] [debug] Scanning directory /etc/ananicy.d/00-default/wine
[2022-06-14 16:32:50.689] [info] Starting Ananicy
[2022-06-14 16:32:50.689] [debug] Cgroup: cpu80, {"CPUQuota":80,"cgroup":"cpu80"}
[2022-06-14 16:32:50.689] [debug] Cgroup: cpu90, {"CPUQuota":90,"cgroup":"cpu90"}
[2022-06-14 16:32:50.689] [debug] Type: Heavy_CPU, {"type":"Heavy_CPU"}
[2022-06-14 16:32:50.689] [debug] Type: web-browser, {"type":"web-browser"}
[2022-06-14 16:32:50.689] [debug] Type: terminal, {"type":"terminal"}
[2022-06-14 16:32:50.689] [debug] Type: torrent, {"ioclass":"idle","sched":"idle","type":"torrent"}
[2022-06-14 16:32:50.689] [debug] Type: VM, {"type":"VM"}
[2022-06-14 16:32:50.689] [debug] Type: screenshotter, {"type":"screenshotter"}
[2022-06-14 16:32:50.689] [debug] Type: torrent-compliant, {"type":"torrent-compliant"}
[2022-06-14 16:32:50.689] [debug] Type: DEWM, {"type":"DEWM"}
[2022-06-14 16:32:50.689] [debug] Type: package-manager, {"type":"package-manager"}
[2022-06-14 16:32:50.689] [debug] Type: chat, {"type":"chat"}
[2022-06-14 16:32:50.689] [debug] Type: compiler, {"nice":1,"type":"compiler"}
[2022-06-14 16:32:50.689] [debug] Type: vpn, {"type":"vpn"}
[2022-06-14 16:32:50.689] [debug] Type: database, {"type":"database"}
[2022-06-14 16:32:50.689] [debug] Type: game-launcher, {"type":"game-launcher"}
[2022-06-14 16:32:50.689] [debug] Type: video-player, {"type":"video-player"}
[2022-06-14 16:32:50.689] [debug] Type: music-player, {"type":"music-player"}
[2022-06-14 16:32:50.689] [debug] Type: ionice=3, {"ionice":3,"type":"ionice=3"}
[2022-06-14 16:32:50.689] [debug] Type: game, {"type":"game"}
[2022-06-14 16:32:50.689] [debug] Type: Doc-View, {"type":"Doc-View"}
[2022-06-14 16:32:50.689] [debug] Type: archiver, {"type":"archiver"}
[2022-06-14 16:32:50.689] [debug] Type: image-viewer, {"type":"image-viewer"}
[2022-06-14 16:32:50.689] [debug] Type: remote-desktop, {"type":"remote-desktop"}
[2022-06-14 16:32:50.689] [debug] Type: server, {"nice":19,"type":"server"}
[2022-06-14 16:32:50.689] [debug] Type: BG_CPUIO, {"type":"BG_CPUIO"}
[2022-06-14 16:32:50.689] [debug] Type: service, {"ionice":7,"nice":19,"type":"service"}
[2022-06-14 16:32:50.689] [debug] Rule: DragonAge2.exe, {"name":"DragonAge2.exe","type":"game"}
[2022-06-14 16:32:50.689] [debug] Rule: HITMAN2.exe, {"name":"HITMAN2.exe","type":"game"}
// abbreviated...
[debug] Cgroup realtime workaround requested, re-checking cgroups
[trace] get_cgroup_version: line = /dev/sda2 / ext4 rw,noatime,discard 0 0
[trace] get_cgroup_version: line = sys /sys sysfs ro,nosuid,nodev,noexec,rel>
[trace] get_cgroup_version: line = securityfs /sys/kernel/security securityf>
[trace] get_cgroup_version: line = cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,>
[2022-06-14 16:32:50.691] [warning] cgroup2 at /sys/fs/cgroup/ananicy_test_cgroup2 doesn't have a cpu controller available, skipping
[warning] cgroup2 at /sys/fs/cgroup/ananicy_test_cgroup2 doesn't have a cpu >
[trace] get_cgroup_version: line = pstore /sys/fs/pstore pstore ro,nosuid,no>
[trace] get_cgroup_version: line = bpf /sys/fs/bpf bpf ro,nosuid,nodev,noexe>
[trace] get_cgroup_version: line = debugfs /sys/kernel/debug debugfs ro,nosu>
[trace] get_cgroup_version: line = tracefs /sys/kernel/tracing tracefs ro,no>
[trace] get_cgroup_version: line = configfs /sys/kernel/config configfs ro,n>
[trace] get_cgroup_version: line = fusectl /sys/fs/fuse/connections fusectl >
[trace] get_cgroup_version: line = run /run tmpfs rw,nosuid,nodev,relatime,m>
[trace] get_cgroup_version: line = tmpfs /tmp tmpfs rw,noatime,inode64 0 0
[trace] get_cgroup_version: line = /dev/sda4 /DATA ext4 rw,nosuid,nodev,noat>
[trace] get_cgroup_version: line = /dev/sda1 /boot ext4 ro,nosuid,noatime,di>
[trace] get_cgroup_version: line = tmpfs /dev tmpfs ro,nosuid,noexec,size=40>
[trace] get_cgroup_version: line = devpts /dev/pts devpts rw,nosuid,noexec,r>
[trace] get_cgroup_version: line = tmpfs /dev/shm tmpfs rw,nosuid,nodev,inod>
[trace] get_cgroup_version: line = mqueue /dev/mqueue mqueue rw,nosuid,nodev>
[trace] get_cgroup_version: line = hugetlbfs /dev/hugepages hugetlbfs rw,nos>
[trace] get_cgroup_version: line = run /home tmpfs ro,nosuid,nodev,noexec,re>
[trace] get_cgroup_version: line = proc /proc proc rw,nosuid,nodev,noexec,re>
[trace] get_cgroup_version: line = run /root tmpfs ro,nosuid,nodev,noexec,re>
[trace] get_cgroup_version: line = run /run/credentials tmpfs ro,nosuid,node>
[trace] get_cgroup_version: line = run /run/systemd/incoming tmpfs ro,nosuid>
[trace] get_cgroup_version: line = run /run/user tmpfs ro,nosuid,nodev,noexe>
[trace] get_cgroup_version: line = tmpfs /tmp tmpfs rw,nosuid,noatime,inode6>
[trace] get_cgroup_version: line = /dev/sda2 /usr ext4 ro,nosuid,noatime,dis>
[trace] get_cgroup_version: line = run /usr/lib/modules tmpfs ro,nosuid,node>
[trace] get_cgroup_version: line = /dev/sda2 /var/tmp ext4 rw,nosuid,noatime>
[trace] get_cgroup_version: line =
[debug] No cgroup info, setting defaults
[debug] Cgroup info: 0, path:
[info] Creating Cgroups...
[2022-06-14 16:32:50.691] [debug] No cgroup info, setting defaults
[2022-06-14 16:32:50.692] [debug] Cgroup info: 0, path:
[2022-06-14 16:32:50.692] [info] Creating Cgroups...
[2022-06-14 16:32:50.692] [warning] Cgroups are not available on this platform (or are not enabled)
[2022-06-14 16:32:50.692] [warning] Cgroups are not available on this platform (or are not enabled)
[2022-06-14 16:32:50.692] [info] Finished creating Cgroups...
[2022-06-14 16:32:50.692] [info] Doing a full scan
[2022-06-14 16:32:50.694] [debug] Full scan found 257 processes
[2022-06-14 16:32:50.695] [info] Worker initialized with 752 rules
[2022-06-14 16:32:50.695] [debug] Found rule for systemd-timesyncd: {"name":"systemd-timesyncd","type":"BG_CPUIO"}
[2022-06-14 16:32:50.695] [debug] Found rule for cupsd: {"name":"cupsd","type":"BG_CPUIO"}
[2022-06-14 16:32:50.695] [debug] Found rule for dnsmasq: {"name":"dnsmasq","type":"Doc-View"}
// abbreviated...
[2022-06-14 16:32:50.695] [debug] Found rule for firefox: {"name":"firefox","type":"web-browser"}
[2022-06-14 16:32:50.795] [debug] Cgroup realtime workaround requested, re-checking cgroups
[2022-06-14 16:32:50.795] [warning] cgroup2 at /sys/fs/cgroup/ananicy_test_cgroup2 doesn't have a cpu controller available, skipping
[2022-06-14 16:32:50.795] [debug] No cgroup info, setting defaults
[2022-06-14 16:32:50.795] [debug] Cgroup info: 0, path:
[2022-06-14 16:32:50.795] [info] Creating Cgroups...
[2022-06-14 16:32:50.795] [warning] Cgroups are not available on this platform (or are not enabled)
[2022-06-14 16:32:50.795] [warning] Cgroups are not available on this platform (or are not enabled)
[2022-06-14 16:32:50.795] [info] Finished creating Cgroups...
[2022-06-14 16:32:52.115] [debug] Found rule for keepassxc: {"name":"keepassxc","type":"Doc-View"}
[2022-06-14 16:32:52.115] [debug] Found rule for keepassxc: {"name":"keepassxc","type":"Doc-View"}
[2022-06-14 16:32:54.164] [debug] Found rule for dropbox: {"name":"dropbox","type":"BG_CPUIO"}
[2022-06-14 16:32:54.164] [debug] Found rule for dropbox: {"name":"dropbox","type":"BG_CPUIO"}
[2022-06-14 16:33:00.795] [debug] Processed processes: 263
[2022-06-14 16:33:10.796] [debug] Processed processes: 265
And ls /sys/fs/cgroup/ananicy_test_cgroup2/
gives me:
cgroup.controllers
cgroup.events
cgroup.freeze
cgroup.kill
cgroup.max.depth
cgroup.max.descendants
cgroup.procs
cgroup.stat
cgroup.subtree_control
cgroup.threads
cgroup.type
cpu.pressure
cpu.stat
io.pressure
memory.current
memory.events
memory.events.local
memory.high
memory.low
memory.max
memory.min
memory.numa_stat
memory.oom.group
memory.pressure
memory.stat
memory.swap.current
memory.swap.events
memory.swap.high
memory.swap.max
pids.current
pids.events
pids.max
Additionally, I have this in my grub entry:
systemd.unified_cgroup_hierarchy=1
Further, I can see some linking of stuff to cgroups:
$ cat /proc/`pidof ananicy-cpp`/cgroup
0::/user.slice/user-1000.slice/session-3.scope
I have the rules from: https://github.com/kuche1/minq-ananicy
Checklist:
-
I mentioned the version used -
I provided log files with loglevel = trace