Repository navigation
Description
Describe the bug
After upgrading to a recent kernel on a Raspberry Pi 5, the memory cgroup functionality has stopped working.
Looking at the non-working configuration (kernel 6.12.34+rpt-rpi-2712), you can see the active command line parameters passed to the linux kernel look like:
root@k8s-master-3:~# uname -a
Linux k8s-master-3 6.12.34+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux
root@k8s-master-3:~# cat /proc/cmdline
reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0 numa=fake=8 system_heap.max_order=0 smsc95xx.macaddr=2C:CF:67:FB:89:3C vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 cgroup_memory=1 cgroup_enable=memory console=ttyAMA10,115200 console=tty1 root=PARTUUID=4d8097e2-02 rootfstype=ext4 fsck.repair=yes rootwait
And /proc/cgroups shows no evidence of memory cgroups being active;
root@k8s-master-3:~# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 0 70 1
cpu 0 70 1
cpuacct 0 70 1
blkio 0 70 1
devices 0 70 1
freezer 0 70 1
net_cls 0 70 1
perf_event 0 70 1
net_prio 0 70 1
pids 0 70 1
But looking at an otherwise identical Raspberry Pi 5 which has an older linux kernel (6.6.74+rpt-rpi-2712), we see the command line and /proc/cgroups output showing that memory cgroups are availble:
root@k8s-master-1:~# uname -a
Linux k8s-master-1 6.6.74+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
root@k8s-master-1:~# cat /proc/cmdline
reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave numa=fake=8 system_heap.max_order=0 smsc95xx.macaddr=2C:CF:67:CF:25:FD vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 cgroup_memory=1 cgroup_enable=memory console=ttyAMA10,115200 console=tty1 root=PARTUUID=612e095f-02 rootfstype=ext4 fsck.repair=yes rootwait
/proc/cgroups:
root@k8s-master-1:~# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 0 123 1
cpu 0 123 1
cpuacct 0 123 1
blkio 0 123 1
memory 0 123 1
devices 0 123 1
freezer 0 123 1
net_cls 0 123 1
perf_event 0 123 1
net_prio 0 123 1
pids 0 123 1
Steps to reproduce the behaviour
Enable memory cgroups by adding cgroup_memory=1 cgroup_enable=memory to /boot/firmware/cmdline.txt. Install/upgrade to linux 6.12.34+rpt-rpi-2712, reboot and see how /proc/cgroups doesn't list memory cgroups as enabled.
Device (s)
Raspberry Pi CM5
System
https://gist.github.com/joelddiaz/d4b75825c9e3f0493ac67cc49d0481b4
Logs
No response
Additional context
Maybe related to this commit...: 86099de
Activity
[-]memory cgroups cannot be enabled[/-][+]memory cgroups cannot be enabled with recent kernel version[/+]nbuchwitz commentedon Jul 29, 2025
Does adding cgroup_enable=memory in cmdline.txt fix this?
joelddiaz commentedon Jul 30, 2025
The /proc/cmdline output is admittedly a mess, but it is in there:
root@k8s-master-3:~# cat /proc/cmdline
reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0 numa=fake=8 system_heap.max_order=0 smsc95xx.macaddr=2C:CF:67:FB:89:3C vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 cgroup_memory=1 ##HERE!!!## cgroup_enable=memory console=ttyAMA10,115200 console=tty1 root=PARTUUID=4d8097e2-02 rootfstype=ext4 fsck.repair=yes rootwait
pelwell commentedon Jul 30, 2025
I'm totally AFK and feeling too lazy to dig, but does removing
cgroup_disable=memory(also present) help?mjmammoth commentedon Jul 30, 2025
I'm having the same problem.
It seems that
cgroup_disable=memoryis prepended as an argument by some other process, probably the bootloader.Having
cgroup_memory=1 cgroup_enable=memoryappended to/boot/firmware/cmdline.txtand rebooting does not solve the issue.cgroup_disable=memoryis not in thecmdline.txtbut still shows up when doingcat /proc/cmdlineOP did actually find this related commit that adds
cgroup_disable=memoryby default.The commit states
I would assume that override isn't working?
nbuchwitz commentedon Jul 30, 2025
Yes, this comes from the bootargs in dt. @pelwell probably something which can be fixed with a dtparam easily. If you'd like I can give it a try
popcornmix commentedon Jul 30, 2025
I think it's something else. I removed
cgroup_disable=memoryfrom DT but it doesn't fix it.We do try to enable it, but no output from
grep memory /proc/cgroups.nbuchwitz commentedon Jul 30, 2025
Without dt change
With dt change
/proc/cgroupsis afaik only for legacy support, but the system is using cgroup v2. So everything as I would expect it with cgroups v2 and modfied cmdline. Alsodocker infodoesn't show any warnings likeWARNING: No memory limit supportanymore.Enabling memory cgroups with
enable_cgroup=memorywithdisable_cgroup=memoryalready present from dt does seem to work (order seems to matter):boshkash1151 commentedon Aug 2, 2025
for anyone facing a similar issue after the recent upgrade this helped me solve it.
I just popped the SD card, mounted it to another devices, edited the cmdline.txt file to include "cgroup_enable=memory cgroup_memory=1", inserting the SD card back
pelwell commentedon Aug 4, 2025
Now that I'm back, I think everything is behaving as expected (at least by me):
cgroup_disable=memorysetting in our default command line settings (as inherited from the DTB files), but to allow users to override it using our (downstream only)cgroup_enable=memorysetting. That should be all that is required - nocgroup_memory=1- as long as you bear in mind that the settings are applied in the order they appear in /proc/cmdline, and that the contents of cmdline.txt appears after the values in the DTB.memoryfrom/proc/cgroups.Does anybody disagree with this?
nbuchwitz commentedon Aug 4, 2025
My own investigation came to the same conclusion (eg. it's working with the new API, if the right cmdline parameter is added). So I agree with your summary.
pelwell commentedon Aug 4, 2025
Thanks. In anticipation of no dissenting voices I'm marking this closed, but that won't prevent further comments if that turns out not to be the case.
joelddiaz commentedon Aug 4, 2025
Not sure why it was failing for me...i guess i might have had a typo at first and then became focused on the output of /proc/cgroups.
Anyway, I can confirm that updating to 6.12.X with the right
cgroup_enable=memory croup_memory=1in /boot/firmware/cmdlline.txt does work as far as cgroups (v2) being enabled.Sorry for the noise, and thanks
pelwell commentedon Aug 4, 2025
No problem - it's good to have to remember this stuff every now and again (but
cgroup_memory=1is not needed - the kernel will complain that it is unrecognised in its log output).redt0mat0 commentedon Nov 4, 2025
`
dmesg -T
...
[Tue Nov 4 16:24:50 2025] Linux version 6.12.57-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1920 SMP PREE
MPT Tue Nov 4 10:15:36 GMT 2025
...
[Tue Nov 4 16:24:50 2025] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 cgroup_disable=memory snd_bcm2835.enable_headphones=1 snd_bcm2835.enab
le_hdmi=1 snd_bcm2835.enable_hdmi=0 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=ttyS0,115200 usbcore.autosuspend=-1 console=tty1 root=PARTUUID=243d3dad-02 rootfsty
pe=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=LU cgroup_enable=memory
...
[Tue Nov 4 16:24:50 2025] cgroup: Disabling memory control group subsystem
[Tue Nov 4 16:24:50 2025] cgroup: Enabling memory control group subsystem
cat /etc/debian_version
12.12
cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 0 99 1
cpu 0 99 1
cpuacct 0 99 1
blkio 0 99 1
devices 0 99 1
freezer 0 99 1
net_cls 0 99 1
perf_event 0 99 1
net_prio 0 99 1
pids 0 99 1
lshw
...
product: Raspberry Pi 3 Model B Plus Rev 1.3
...
`
Didn't find a way to activate "memory" in cgroups on Pi3B+ with kernel 6.12.57.
Any clue is welcome.
update
My bad! /proc/cgroup is the old API, unsupported now.
Running kubeadm again after adding "cgroup_enable=memory" shows it works :-)
May this post help...
pelwell commentedon Nov 4, 2025
It's more support for the view that, until they change the kernel API again, if it doesn't work you are probably doing it wrong.
Enforce metrics memory limits on the Pi 5 UPS hosts (#6)