Problem with resources limitation (cpu, memory, ...)

I don’t think the problem is related to a rpi hack. With the debian 11 image there is no hack others than boot sequence before loading the initramfs.

With cgroupv1 enabled in hybrid mode (added systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false parameters to the kernel at boot) everything works fine.
I don’t know where the problem is located.

Edit: just found the solution. lxc keys name differ from cgroupv1, explained here : Limitations not applied inside of containers