Steven Rostedt
b9ef0326c0
tracing: Move postpone selftests to core from early_initcall
I hit the following lockdep splat when booting with ftrace selftests
enabled, as well as CONFIG_PREEMPT and LOCKDEP.
Testing dynamic ftrace ops #1:
(1 0 1 0 0)
(1 1 2 0 0)
(2 1 3 0 169)
(2 2 4 0 50066)
------------[ cut here ]------------
WARNING: CPU: 0 PID: 13 at kernel/rcu/srcutree.c:202 check_init_srcu_struct+0x60/0x70
Modules linked in:
CPU: 0 PID: 13 Comm: rcu_tasks_kthre Not tainted 4.12.0-rc1-test+ #587
Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v02.05 05/07/2012
task: ffff880119628040 task.stack: ffffc900006a4000
RIP: 0010:check_init_srcu_struct+0x60/0x70
RSP: 0000:ffffc900006a7d98 EFLAGS: 00010246
RAX: 0000000000000246 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff880119628040 RSI: 00000000ffffffff RDI: ffffffff81e5fb40
RBP: ffffc900006a7e20 R08: 00000023b403c000 R09: 0000000000000001
R10: ffffc900006a7e40 R11: 0000000000000000 R12: ffffffff81e5fb40
R13: 0000000000000286 R14: ffff880119628040 R15: ffffc900006a7e98
FS: 0000000000000000(0000) GS:ffff88011ea00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff88011edff000 CR3: 0000000001e0f000 CR4: 00000000001406f0
Call Trace:
? __synchronize_srcu+0x6e/0x140
? lock_acquire+0xdc/0x1d0
? ktime_get_mono_fast_ns+0x5d/0xb0
synchronize_srcu+0x6f/0x110
? synchronize_srcu+0x6f/0x110
rcu_tasks_kthread+0x20a/0x540
kthread+0x114/0x150
? __rcu_read_unlock+0x70/0x70
? kthread_create_on_node+0x40/0x40
ret_from_fork+0x2e/0x40
Code: f6 83 70 06 00 00 03 49 89 c5 74 0d be 01 00 00 00 48 89 df e8 42 fa ff ff 4c 89 ee 4c 89 e7 e8 b7 42 75 00 5b 41 5c 41 5d 5d c3 <0f> ff eb aa 66 90 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
---[ end trace 5c3f4206ce50f6ac ]---
What happens is that the selftests include a creating of a dynamically
allocated ftrace_ops, which requires the use of synchronize_rcu_tasks()
which uses srcu, and triggers the above warning.
It appears that synchronize_rcu_tasks() is not set up at early_initcall(),
but it is at core_initcall(). By moving the tests down to that location
works out properly.
Link: http://lkml.kernel.org/r/20170517111435.7388c033@gandalf.local.home
Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-17 21:39:38 -04:00
..
2017-05-09 15:42:31 -07:00
2017-05-01 13:52:24 -07:00
2017-02-27 18:43:46 -08:00
2017-03-02 08:42:34 +01:00
2017-05-10 07:54:00 +02:00
2017-05-12 15:57:15 -07:00
2017-05-08 19:03:25 -07:00
2017-05-01 21:49:28 +02:00
2017-05-10 10:30:46 -07:00
2017-05-10 09:12:30 -07:00
2017-05-08 18:49:23 -07:00
2017-05-10 10:30:46 -07:00
2017-05-10 10:30:46 -07:00
2017-05-12 15:57:15 -07:00
2017-05-17 21:39:38 -04:00
2017-03-02 08:42:39 +01:00
2017-05-03 11:05:15 -07:00
2017-05-03 11:05:15 -07:00
2017-05-03 11:05:15 -07:00
2017-05-03 09:21:59 -07:00
2017-05-02 10:16:05 -04:00
2017-05-02 10:16:05 -04:00
2017-05-03 11:05:15 -07:00
2017-01-12 07:01:56 -07:00
2017-04-14 21:49:56 +02:00
2016-12-24 11:46:01 -08:00
2017-04-14 10:29:40 +02:00
2017-05-08 17:15:11 -07:00
2017-03-02 08:42:28 +01:00
2017-03-02 08:42:39 +01:00
2017-03-09 17:01:09 -08:00
2017-02-22 10:15:09 -08:00
2017-05-12 10:41:45 -07:00
2016-12-24 11:46:01 -08:00
2017-04-15 16:03:46 +02:00
2017-05-08 17:15:13 -07:00
2017-05-08 17:15:10 -07:00
2017-02-27 13:26:17 -08:00
2017-02-17 13:40:05 -05:00
2017-05-08 17:15:12 -07:00
2017-05-08 17:15:11 -07:00
2017-03-10 20:55:09 +01:00
2017-03-10 20:55:09 +01:00
2017-03-02 08:42:39 +01:00
2017-05-05 11:36:44 -07:00
2017-05-08 17:15:11 -07:00
2017-03-17 10:18:47 -04:00
2017-03-02 08:42:39 +01:00
2017-05-08 17:15:11 -07:00
2017-01-23 11:32:16 -08:00
2017-05-01 09:15:53 +02:00
2017-05-08 17:15:14 -07:00
2017-02-24 17:46:56 -08:00
2017-03-13 15:57:41 -03:00
2017-04-21 20:30:46 +08:00
2017-03-02 08:42:34 +01:00
2017-04-18 10:37:13 +02:00
2017-05-08 17:15:12 -07:00
2017-05-08 17:15:12 -07:00
2017-03-02 08:42:39 +01:00
2017-04-08 00:47:48 -07:00
2017-05-02 11:38:06 -07:00
2017-03-02 08:42:36 +01:00
2017-05-10 10:30:46 -07:00
2017-03-02 08:42:26 +01:00
2017-03-02 08:42:35 +01:00
2017-04-11 09:06:32 +02:00
2017-03-08 09:18:02 +01:00
2016-12-22 22:58:37 -05:00
2017-05-05 11:08:43 -07:00
2017-04-21 15:59:52 -04:00
2017-05-08 17:15:10 -07:00
2017-05-08 17:15:12 -07:00
2017-03-02 08:42:27 +01:00
2017-03-02 08:42:35 +01:00
2017-03-02 08:42:39 +01:00
2017-03-06 15:26:37 -06:00
2017-03-02 08:42:31 +01:00
2017-03-02 08:42:29 +01:00
2017-03-02 08:42:29 +01:00
2017-03-03 01:45:36 +01:00
2017-03-02 08:42:38 +01:00
2017-03-02 08:42:34 +01:00
2017-03-02 08:42:34 +01:00
2017-05-01 19:12:53 -07:00