RPi4 / 5.10 kernel missing cgroups_memory, docker memory stats all missing

Recently updated my RPi4 to the August release / buster, kernel 5.10.32-1

I use docker with a few containers. Overall, everything works flawlessly in the new OSMC release but I found a quirk, I have a grafana dashboard showing stats of the RPi including memory consumption by each of the docker containers I have, and after the upgrade, I noticed all the container memory counters went down to zero. The memory counters come from this CLI command

docker stats

Which lists the running containers, CPU utilization, memory etc - and memory in the RPi4 shows as zero for all containers.

After a little research, I found this:

https://www.raspberrypi.org/forums/viewtopic.php?t=203128

and confirmed that in OSMC, cgroups memory is not activated,

cat /proc/cgroups
#subsys_name	hierarchy	num_cgroups	enabled
cpuset	2	4	1
cpu	7	66	1
cpuacct	7	66	1
blkio	4	66	1
memory	0	68	0
devices	9	66	1
freezer	8	4	1
net_cls	3	4	1
perf_event	6	4	1
net_prio	3	4	1
pids	5	69	1

@sam_nazarko is it possible to enable this in OSMC’s new kernel? There should be no downsides and it was enabled before the upgrade to buster (I am sure of this because my stats collection script that uses ‘docker stats’ was working fine, for years). It will improve docker support out of the box.

p.s. I modified cmdline.txt to:

osmc@rpi ~> cat /boot/cmdline.txt
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp4 cgroup_memory=1 cgroup_enable=memory

and docker stats works fine now. No issues with the system (running kodi and a few containers simultaneously)

2 Likes