Nitrax
Posts: 12
Joined: Sun Mar 15, 2020 4:06 pm

Cgroups not loaded after kernel upgrade

Tue Jul 21, 2020 4:16 pm

Cgroups are not loaded after kernel upgrade

(the tests done on 3b+, but i noticed the same on my rpi4)

Before update (cat /proc/cgroups):

Code: Select all

Linux kessel 4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020 armv7l GNU/Linux
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  6       1       1
cpu     4       1       1
cpuacct 4       1       1
blkio   8       1       1
memory  9       132     1
devices 5       32      1
freezer 2       1       1
net_cls 3       1       1
pids    7       37      1
After update: (blkio and memory missing)

Code: Select all

Linux kessel 5.4.51-v7+ #1326 SMP Fri Jul 17 10:45:25 BST 2020 armv7l GNU/Linux
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  4       1       1
cpu     5       1       1
cpuacct 5       1       1
devices 6       32      1
freezer 3       1       1
net_cls 7       1       1
pids    2       36      1
cgroup cmdline paramters doing no difference on 32-bit kernel.

After switch to 64-bit kernel, but standard cmdline.txt (memory cgroup exist but is not active):

Code: Select all

Linux kessel 5.4.51-v8+ #1326 SMP PREEMPT Fri Jul 17 10:58:13 BST 2020 aarch64 GNU/Linux
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  5       1       1
cpu     6       33      1
cpuacct 6       33      1
blkio   4       33      1
memory  0       39      0
devices 3       33      1
freezer 2       1       1
net_cls 8       1       1
pids    7       37      1
After 64-bit-kernel and added cgroup_enable=memory to cmdline.txt, k3s is again working:

Code: Select all

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  7       1       1
cpu     3       35      1
cpuacct 3       35      1
blkio   8       35      1
memory  4       70      1
devices 9       35      1
freezer 2       1       1
net_cls 5       1       1
pids    6       39      1

Nitrax
Posts: 12
Joined: Sun Mar 15, 2020 4:06 pm

Re: Cgroups not loaded after kernel upgrade

Wed Jul 22, 2020 2:57 pm

After researching some, it seems CONFIG_MEMCG is not enabled for armhf in latest kernel, and this only affects kubernetes installs (k3s specifically) that required memory cgroup and docker setups which uses memory limits

I fixed the problem by moving to 64bit

cBiscuitSurprise
Posts: 1
Joined: Thu Jul 23, 2020 1:34 pm

Re: Cgroups not loaded after kernel upgrade

Thu Jul 23, 2020 1:51 pm

I barely have any hair after the last 2 days of "I'll just quickly setup a new pi 3"... :x

I'm glad to know it's not something I was blatantly missing.

Did you just use Ubuntu 64bit?

pokeswithastick
Posts: 5
Joined: Wed Feb 19, 2020 6:52 pm

Re: Cgroups not loaded after kernel upgrade

Thu Jul 23, 2020 5:28 pm

Likewise. I was able to get the nodes back on line by adding arm_64bit=1 to /boot/config.txt.

Unfortunately that seems to have upset some containers running JVM JNI code possibly due to the architecture now being aarch64 instead of armv7l.

I'm going to try downgrading to an older 4x kernel.

pokeswithastick
Posts: 5
Joined: Wed Feb 19, 2020 6:52 pm

Re: Cgroups not loaded after kernel upgrade

Thu Jul 23, 2020 5:36 pm

sudo rpi-update e1050e94821a70b2e4c72b318d6c6c968552e9a2

downgrades to the last 4x kernel and seems to have done the trick.

facedeodorant
Posts: 1
Joined: Tue Jul 28, 2020 9:58 pm

Re: Cgroups not loaded after kernel upgrade

Tue Jul 28, 2020 10:22 pm

I had the offending kernel installed in armv7l mode, and had the same issue with cgroups not being enabled, even with cmdline.txt set up correctly.

Code: Select all

pi@raspberrypi:~ $ sudo uname -a
Linux raspberrypi 5.4.51-v7+ #1327 SMP Thu Jul 23 10:58:46 BST 2020 armv7l GNU/Linux

I considered downgrading the kernel, but I found that a new build of the kernel with those cgroups re-enabled is available, and can be installed with rpi-update.

See the commit here https://github.com/Hexxeh/rpi-firmware/ ... fbc8c8d7ab in the repo that rpi-update uses.

I was able to roll forward instead of backward with:

Code: Select all

sudo rpi-update 56f62dee2a2385fe030724f7b39344fbc8c8d7ab

Return to “Raspberry Pi OS”