Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1231901 > unrolled thread

WARNING: static_key_slow_dec used before call to jump_label_init

Started byAndrey Wagin <avagin@gmail.com>
First post2015-09-24 09:00 +0200
Last post2015-09-25 22:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  WARNING: static_key_slow_dec used before call to jump_label_init Andrey Wagin <avagin@gmail.com> - 2015-09-24 09:00 +0200
    Re: WARNING: static_key_slow_dec used before call to jump_label_init Andrey Wagin <avagin@gmail.com> - 2015-09-24 09:20 +0200
    [PATCH cgroup/for-4.4] cgroup: fix too early usage of  static_branch_disable() Tejun Heo <tj@kernel.org> - 2015-09-25 22:30 +0200

#1231901 — WARNING: static_key_slow_dec used before call to jump_label_init

FromAndrey Wagin <avagin@gmail.com>
Date2015-09-24 09:00 +0200
SubjectWARNING: static_key_slow_dec used before call to jump_label_init
Message-ID<qc8FB-3Sb-23@gated-at.bofh.it>
Hello,

I booted kernel with cgroup_disable=cpu and get this warning:

[    0.000000] Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc2-next-20150923 no_timer_check
console=ttyS0,115200n8 root=UUID=01bc7316-b1f4-45c9-a23a-0
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:99
static_key_slow_dec+0x44/0x60()
[    0.000000] static_key_slow_dec used before call to jump_label_init
[    0.000000] Modules linked in:

[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
4.3.0-rc2-next-20150924 #1
[    0.000000] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[    0.000000]  0000000000000000 ebd8af5cfcdffb28 ffffffff81c03da8
ffffffff813b18c2
[    0.000000]  ffffffff81c03df0 ffffffff81c03de0 ffffffff8108dd52
ffffffff81c5bad0
[    0.000000]  ffff88003ffe663a ffffffff81c49a00 0000000000000001
ffff88003ffe662b
[    0.000000] Call Trace:
[    0.000000]  [<ffffffff813b18c2>] dump_stack+0x44/0x62
[    0.000000]  [<ffffffff8108dd52>] warn_slowpath_common+0x82/0xc0
[    0.000000]  [<ffffffff8108ddec>] warn_slowpath_fmt+0x5c/0x80
[    0.000000]  [<ffffffff8119c054>] static_key_slow_dec+0x44/0x60
[    0.000000]  [<ffffffff81d826b6>] cgroup_disable+0xaf/0xd6
[    0.000000]  [<ffffffff81d5f9de>] unknown_bootoption+0x8c/0x194
[    0.000000]  [<ffffffff810b0c03>] parse_args+0x273/0x4a0
[    0.000000]  [<ffffffff8119d592>] ? printk+0x57/0x73
[    0.000000]  [<ffffffff81d5fd67>] start_kernel+0x205/0x4b8
[    0.000000]  [<ffffffff81d5f952>] ? set_init_arg+0x55/0x55
[    0.000000]  [<ffffffff81d5f120>] ? early_idt_handler_array+0x120/0x120
[    0.000000]  [<ffffffff81d5f315>] x86_64_start_reservations+0x2a/0x2c
[    0.000000]  [<ffffffff81d5f461>] x86_64_start_kernel+0x14a/0x16d
[    0.000000] ---[ end trace 8a774ae3ff020690 ]---

Thanks,
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1231913

FromAndrey Wagin <avagin@gmail.com>
Date2015-09-24 09:20 +0200
Message-ID<qc8YW-4tW-27@gated-at.bofh.it>
In reply to#1231901
2015-09-24 9:57 GMT+03:00 Andrey Wagin <avagin@gmail.com>:
> Hello,
>
> I booted kernel with cgroup_disable=cpu and get this warning:
>
> [    0.000000] Kernel command line:
> BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc2-next-20150923 no_timer_check
> console=ttyS0,115200n8 root=UUID=01bc7316-b1f4-45c9-a23a-0

[    0.000000] Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-4.3.0-rc2-next-20150923 no_timer_check
console=ttyS0,115200n8 root=UUID=01bc7316-b1f4-45c9-a23a-00c5a2336ef2
console=tty1 ro rhgb quiet LANG=en_US.UTF-8
initrd=/boot/initramfs-4.3.0-rc2-next-20150923.img debug
cgroup_disable=cpu
You have new mail in /var/spool/mail/root

> [    0.000000] ------------[ cut here ]------------
> [    0.000000] WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:99
> static_key_slow_dec+0x44/0x60()
> [    0.000000] static_key_slow_dec used before call to jump_label_init
> [    0.000000] Modules linked in:
>
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
> 4.3.0-rc2-next-20150924 #1
> [    0.000000] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
> [    0.000000]  0000000000000000 ebd8af5cfcdffb28 ffffffff81c03da8
> ffffffff813b18c2
> [    0.000000]  ffffffff81c03df0 ffffffff81c03de0 ffffffff8108dd52
> ffffffff81c5bad0
> [    0.000000]  ffff88003ffe663a ffffffff81c49a00 0000000000000001
> ffff88003ffe662b
> [    0.000000] Call Trace:
> [    0.000000]  [<ffffffff813b18c2>] dump_stack+0x44/0x62
> [    0.000000]  [<ffffffff8108dd52>] warn_slowpath_common+0x82/0xc0
> [    0.000000]  [<ffffffff8108ddec>] warn_slowpath_fmt+0x5c/0x80
> [    0.000000]  [<ffffffff8119c054>] static_key_slow_dec+0x44/0x60
> [    0.000000]  [<ffffffff81d826b6>] cgroup_disable+0xaf/0xd6
> [    0.000000]  [<ffffffff81d5f9de>] unknown_bootoption+0x8c/0x194
> [    0.000000]  [<ffffffff810b0c03>] parse_args+0x273/0x4a0
> [    0.000000]  [<ffffffff8119d592>] ? printk+0x57/0x73
> [    0.000000]  [<ffffffff81d5fd67>] start_kernel+0x205/0x4b8
> [    0.000000]  [<ffffffff81d5f952>] ? set_init_arg+0x55/0x55
> [    0.000000]  [<ffffffff81d5f120>] ? early_idt_handler_array+0x120/0x120
> [    0.000000]  [<ffffffff81d5f315>] x86_64_start_reservations+0x2a/0x2c
> [    0.000000]  [<ffffffff81d5f461>] x86_64_start_kernel+0x14a/0x16d
> [    0.000000] ---[ end trace 8a774ae3ff020690 ]---
>
> Thanks,
> Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1233057 — [PATCH cgroup/for-4.4] cgroup: fix too early usage of static_branch_disable()

FromTejun Heo <tj@kernel.org>
Date2015-09-25 22:30 +0200
Subject[PATCH cgroup/for-4.4] cgroup: fix too early usage of static_branch_disable()
Message-ID<qcHMZ-3Ev-9@gated-at.bofh.it>
In reply to#1231901
49d1dc4b8179 ("cgroup: implement static_key based
cgroup_subsys_enabled() and cgroup_subsys_on_dfl()") converted cgroup
enabled test to use static_key; however, cgroup_disable() is called
before static_key subsystem itself is initialized and thus leads to
the following warning when "cgroup_disable=" parameter is specified.

 WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:99 static_key_slow_dec+0x44/0x60()
 static_key_slow_dec used before call to jump_label_init
 ...
 Call Trace:
  [<ffffffff813b18c2>] dump_stack+0x44/0x62
  [<ffffffff8108dd52>] warn_slowpath_common+0x82/0xc0
  [<ffffffff8108ddec>] warn_slowpath_fmt+0x5c/0x80
  [<ffffffff8119c054>] static_key_slow_dec+0x44/0x60
  [<ffffffff81d826b6>] cgroup_disable+0xaf/0xd6
  [<ffffffff81d5f9de>] unknown_bootoption+0x8c/0x194
  [<ffffffff810b0c03>] parse_args+0x273/0x4a0
  [<ffffffff81d5fd67>] start_kernel+0x205/0x4b8
 ...

Fix it by making cgroup_disable() to record the subsystems to disable
in cgroup_disable_mask and moving the actual application to
cgroup_init() which is late enough and where the enabled state is
first used.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Andrey Wagin <avagin@gmail.com>
Link: http://lkml.kernel.org/g/CANaxB-yFuS4SA2znSvcKrO9L_CbHciHYW+o9bN8sZJ8eR9FxYA@mail.gmail.com
Fixes: 49d1dc4b81797f88270832b11e9f73809e7e7209
---
 kernel/cgroup.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f924158..ae23814 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5124,6 +5124,8 @@ int __init cgroup_init_early(void)
 	return 0;
 }
 
+static unsigned long cgroup_disable_mask __initdata;
+
 /**
  * cgroup_init - cgroup initialization
  *
@@ -5170,8 +5172,12 @@ int __init cgroup_init(void)
 		 * disabled flag and cftype registration needs kmalloc,
 		 * both of which aren't available during early_init.
 		 */
-		if (!cgroup_ssid_enabled(ssid))
+		if (cgroup_disable_mask & (1 << ssid)) {
+			static_branch_disable(cgroup_subsys_enabled_key[ssid]);
+			printk(KERN_INFO "Disabling %s control group subsystem\n",
+			       ss->name);
 			continue;
+		}
 
 		cgrp_dfl_root.subsys_mask |= 1 << ss->id;
 
@@ -5595,11 +5601,7 @@ static int __init cgroup_disable(char *str)
 			if (strcmp(token, ss->name) &&
 			    strcmp(token, ss->legacy_name))
 				continue;
-
-			static_branch_disable(cgroup_subsys_enabled_key[i]);
-			printk(KERN_INFO "Disabling %s control group subsystem\n",
-			       ss->name);
-			break;
+			cgroup_disable_mask |= 1 << i;
 		}
 	}
 	return 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web