linux-next: arm32: beagleboard x15: WARNING: CPU: 0 PID: 0 at /usr/src/kernel/kernel/cgroup/cgroup.c:1969 cgroup_setup_root+0x36c/0x4e8
Subsystems (2)
On arm32 beagleboard x15 the kernel warning generated while booting linux next kernel 5.4.0-rc7-next-20191113. The config link attached to this email.
metadata:
git branch: master
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git commit: 4e8f108c3af2d6922a64df9f3d3d488c74f6009d
git describe: next-20191113
make_kernelversion: 5.4.0-rc7
kernel-config:
http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/am57xx-evm/lkft/linux-next/645/config
Kernel warning log from boot:
--------------------------------------
[ 0.015346] ------------[ cut here ]------------ [ 0.015402] WARNING: CPU: 0 PID: 0 at /usr/src/kernel/kernel/cgroup/cgroup.c:1969 cgroup_setup_root+0x36c/0x4e8 [ 0.015425] Modules linked in: [ 0.015457] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-rc7-next-20191113 #1 [ 0.015474] Hardware name: Generic DRA74X (Flattened Device Tree) [ 0.015490] Backtrace: [ 0.015516] [<c040f9d0>] (dump_backtrace) from [<c040fce4>] (show_stack+0x20/0x24) [ 0.015536] r7:c1fcf52c r6:00000000 r5:60000053 r4:c1fcf52c [ 0.015558] [<c040fcc4>] (show_stack) from [<c13751b4>] (dump_stack+0xe8/0x114) [ 0.015582] [<c13750cc>] (dump_stack) from [<c0459f2c>] (__warn+0x100/0x118) [ 0.015602] r10:c1e48108 r9:c053afb4 r8:000007b1 r7:c19ba84c r6:00000009 r5:00000000 [ 0.015619] r4:00000000 r3:3b5e5f67 [ 0.015641] [<c0459e2c>] (__warn) from [<c0459ffc>] (warn_slowpath_fmt+0xb8/0xc0) [ 0.015660] r9:00000009 r8:c053afb4 r7:000007b1 r6:c19ba84c r5:00000000 r4:c1e086c8 [ 0.015683] [<c0459f48>] (warn_slowpath_fmt) from [<c053afb4>] (cgroup_setup_root+0x36c/0x4e8) [ 0.015702] r9:c1e48c40 r8:c1e48c28 r7:00000001 r6:00000001 r5:c1e086c8 r4:c1e01f24 [ 0.015726] [<c053ac48>] (cgroup_setup_root) from [<c1c2a260>] (cgroup_init+0x108/0x560) [ 0.015745] r10:c200d880 r9:00000001 r8:ffffffff r7:c200d880 r6:c26340e0 r5:c200d8d4 [ 0.015760] r4:c1e48108 [ 0.015782] [<c1c2a158>] (cgroup_init) from [<c1c010fc>] (start_kernel+0x4f0/0x534) [ 0.015800] r10:c200d880 r9:00000001 r8:ffffffff r7:c200d880 r6:c1cf8a64 r5:c200d8d4 [ 0.015816] r4:c1e086c8 [ 0.015838] [<c1c00c0c>] (start_kernel) from [<00000000>] (0x0) [ 0.015856] r10:30c5387d r9:412fc0f2 r8:8ffdd000 r7:00000000 r6:30c0387d r5:00000000 [ 0.015872] r4:c1c00330 [ 0.015888] irq event stamp: 413 [ 0.015916] hardirqs last enabled at (421): [<c04d88e8>] console_unlock+0x47c/0x670 [ 0.015941] hardirqs last disabled at (428): [<c04d8544>] console_unlock+0xd8/0x670 [ 0.015968] softirqs last enabled at (12): [<c0402f44>] __do_softirq+0x3e4/0x5d0 [ 0.015993] softirqs last disabled at (5): [<c0463e24>] irq_exit+0x170/0x180 [ 0.016029] ---[ end trace b9be8c6dacc21523 ]---
complete test log link,
https://qa-reports.linaro.org/lkft/linux-next-oe/build/next-20191113/testrun/1008653/log
- Naresh
Tejun Heo
maintainerHello, Naresh.
Quoted 2 lines · Naresh Kamboju
[ 0.015402] WARNING: CPU: 0 PID: 0 at /usr/src/kernel/kernel/cgroup/cgroup.c:1969
cgroup_setup_root+0x36c/0x4e8
...
Quoted 2 lines
[ 0.015726] [<c053ac48>] (cgroup_setup_root) from [<c1c2a260>](
cgroup_init+0x108/0x560)
So, that's saying that the initial kernfs_node ino allocation returned something other than 1. Hmmm... x86_32 works fine. What does the following say?
# mkdir -p /tmp/cgroup2 # mount -t cgroup2 none /tmp/cgroup2 # ls -lid /tmp/cgroup2
Thanks.
Signature · 1 line
tejun
Tejun Heo
maintainerPATCH 1/1 cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()
Never mind. I just failed to see the warning on x86_32. The warning is spurious and fixed with the following commit. Applied to cgroup/for-5.5.
Thanks.
------ 8< ------
From d7495343228f30d8206e92dccfd1c41adcfa142d Mon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
Date: Thu, 14 Nov 2019 14:46:51 -0800
743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID") added WARN which triggers if cgroup_id(root_cgrp) is not 1. This is fine on 64bit ino archs but on 32bit archs cgroup ID is ((gen << 32) | ino) and gen starts at 1, so the root id is 0x1_0000_0001 instead of 1 always triggering the WARN.
What we wanna make sure is that the ino part is 1. Fix it.
--- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cgroup.c +1 -1
@@ -1966,7 +1966,7 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask) goto exit_root_id; } root_cgrp->kn = root->kf_root->kn; -WARN_ON_ONCE (cgroup_id (root_cgrp) !=1 ); +WARN_ON_ONCE (cgroup_ino (root_cgrp) !=1 ); root_cgrp->ancestor_ids[0 ] =cgroup_id (root_cgrp); ret =css_populate_dir (&root_cgrp->self);
Signature · 1 line
2.17.1
Hi Tejun,
Quoted 6 lines · Tejun Heo
Quoted 2 lines
[ 0.015402] WARNING: CPU: 0 PID: 0 at /usr/src/kernel/kernel/cgroup/cgroup.c:1969
cgroup_setup_root+0x36c/0x4e8...
Quoted 2 lines
[ 0.015726] [<c053ac48>] (cgroup_setup_root) from [<c1c2a260>](
cgroup_init+0x108/0x560)
Quoted 7 lines
So, that's saying that the initial
kernfs_nodeino allocation returned something other than 1. Hmmm...x86_32works fine. What does the following say?# mkdir -p /tmp/cgroup2 # mount -t cgroup2 none /tmp/cgroup2 # ls -lid /tmp/cgroup2
mkdir -p /tmp/cgroup2
mount -t cgroup2 none /tmp/cgroup2
ls -lid /tmp/cgroup2
1 dr-xr-xr-x 5 root root 0 Nov 15 08:00 /tmp/cgroup2
Full test log link,
https://lkft.validation.linaro.org/scheduler/job/1011451#L1170
- Naresh