Joel Fernandes (Google)
da25a672cf
trace: Use rcu_dereference_raw for hooks from trace-event subsystem
Since we switched to using SRCU for tracepoints used in the idle path,
we can no longer use rcu_dereference_sched for dereferencing points in
trace-event hooks.
Since tracepoints can now use either SRCU or sched-RCU, just use
rcu_dereference_raw for traceevents just like we're doing when
dereferencing the tracepoint table.
This prevents an RCU warning reported by Masami:
[ 282.060593] WARNING: can't dereference registers at 00000000f3c7f62b
[ 282.063200] =============================
[ 282.064082] WARNING: suspicious RCU usage
[ 282.064963] 4.18.0-rc6+ #15 Tainted: G W
[ 282.066048] -----------------------------
[ 282.066923] /home/mhiramat/ksrc/linux/kernel/trace/trace_events.c:242
suspicious rcu_dereference_check() usage!
[ 282.068974]
[ 282.068974] other info that might help us debug this:
[ 282.068974]
[ 282.070770]
[ 282.070770] RCU used illegally from idle CPU!
[ 282.070770] rcu_scheduler_active = 2, debug_locks = 1
[ 282.072938] RCU used illegally from extended quiescent state!
[ 282.074183] no locks held by swapper/0/0.
[ 282.075071]
[ 282.075071] stack backtrace:
[ 282.076121] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W
[ 282.077782] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
[ 282.079604] Call Trace:
[ 282.080212] <IRQ>
[ 282.080755] dump_stack+0x85/0xcb
[ 282.081523] trace_event_ignore_this_pid+0x66/0x70
[ 282.082541] trace_event_raw_event_preemptirq_template+0xa2/0xb0
[ 282.083774] ? interrupt_entry+0xc4/0xe0
[ 282.084665] ? trace_hardirqs_off_thunk+0x1a/0x1c
[ 282.085669] trace_hardirqs_off_caller+0x90/0xd0
[ 282.086597] trace_hardirqs_off_thunk+0x1a/0x1c
[ 282.087433] ? call_function_interrupt+0xa/0x20
[ 282.088201] interrupt_entry+0xc4/0xe0
[ 282.088848] ? call_function_interrupt+0xa/0x20
[ 282.089579] </IRQ>
[ 282.090029] ? native_safe_halt+0x2/0x10
[ 282.090695] ? default_idle+0x1f/0x160
[ 282.091330] ? default_idle_call+0x24/0x40
[ 282.091997] ? do_idle+0x210/0x250
[ 282.092658] ? cpu_startup_entry+0x6f/0x80
[ 282.093338] ? start_kernel+0x49d/0x4bd
[ 282.093987] ? secondary_startup_64+0xa5/0xb0
Link: http://lkml.kernel.org/r/20180803023407.225852-1-joel@joelfernandes.org
Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: e6753f23d9
("tracepoint: Make rcuidle tracepoint callers use SRCU")
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-08-03 09:38:39 -04:00
..
2018-07-12 14:00:54 -07:00
2018-06-15 18:10:01 -03:00
2018-06-15 07:15:28 +09:00
2018-06-12 16:19:22 -07:00
2018-06-28 14:00:40 +02:00
2018-06-27 09:55:58 +02:00
2018-06-08 18:56:02 +09:00
2018-06-22 14:22:00 +02:00
2018-04-17 13:42:48 +02:00
2018-07-31 11:32:27 -04:00
2018-06-15 18:10:01 -03:00
2018-06-06 16:04:55 -07:00
2018-06-12 16:19:22 -07:00
2018-07-31 11:32:27 -04:00
2018-07-10 22:12:47 +02:00
2018-08-03 09:38:39 -04:00
2018-01-04 16:45:09 -08:00
2018-02-06 18:32:44 -08:00
2018-05-18 14:58:22 +02:00
2018-05-18 14:58:22 +02:00
2018-06-17 05:06:18 +09:00
2018-05-14 17:24:18 -04:00
2018-02-23 11:22:22 -05:00
2018-05-18 15:47:54 -04:00
2018-05-21 14:27:43 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-04 20:27:54 -07:00
2017-07-31 13:09:49 +02:00
2018-03-15 20:34:40 +01:00
2018-06-07 17:34:37 -07:00
2018-04-27 14:34:51 +02:00
2018-05-16 07:23:35 +02:00
2017-11-02 11:10:55 +01:00
2018-05-16 07:23:35 +02:00
2018-04-02 20:14:51 +02:00
2018-02-21 16:54:06 +01:00
2018-06-12 16:19:22 -07:00
2018-07-21 15:24:03 -07:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:46 -08:00
2017-12-14 16:00:49 -08:00
2018-06-07 17:34:39 -07:00
2018-05-15 23:08:33 -07:00
2018-01-08 19:43:15 +01:00
2018-03-20 08:57:17 +01:00
2018-02-01 13:36:15 -08:00
2017-11-02 11:10:55 +01:00
2018-06-15 07:55:24 +09:00
2018-06-15 07:55:24 +09:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:15:01 +02:00
2017-09-08 18:26:51 -07:00
2018-04-25 10:27:56 -04:00
2017-07-12 16:25:59 -07:00
2018-07-26 09:59:33 -04:00
2018-06-14 08:50:37 +02:00
2018-05-22 06:59:39 -07:00
2018-06-16 07:36:39 +09:00
2018-01-05 18:43:00 +11:00
2018-06-14 12:21:18 +09:00
2018-04-11 10:28:37 -07:00
2018-04-03 19:15:32 -07:00
2018-04-11 10:28:39 -07:00
2018-02-06 18:32:46 -08:00
2017-11-02 11:10:55 +01:00
2017-11-17 16:10:04 -08:00
2018-06-15 07:55:24 +09:00
2018-06-08 17:21:52 -07:00
2018-07-10 22:18:52 +02:00
2018-06-06 16:34:00 -07:00
2018-06-10 06:14:01 +02:00
2017-11-08 11:13:50 +01:00
2017-10-04 10:53:54 +02:00
2017-11-02 11:10:55 +01:00
2018-07-17 11:12:43 -07:00
2018-07-15 12:12:45 +02:00
2018-06-10 10:17:09 -07:00
2018-06-07 17:34:34 -07:00
2018-04-16 11:26:49 +02:00
2018-06-12 16:19:22 -07:00
2017-12-17 13:57:15 +01:00
2018-02-06 18:32:46 -08:00
2017-10-20 11:02:54 +02:00
2018-05-15 10:27:29 -07:00
2018-07-30 19:13:03 -04:00
2018-04-05 21:36:27 -07:00
2018-04-02 20:15:59 +02:00
2018-04-02 20:15:30 +02:00
2018-06-07 16:56:28 -04:00
2017-08-29 15:14:38 +02:00
2018-06-12 16:19:22 -07:00
2018-02-22 10:21:02 -08:00
2018-04-11 10:28:35 -07:00
2017-11-04 08:53:04 +01:00
2017-11-08 10:17:15 +01:00
2018-05-18 08:47:13 -07:00
2018-06-12 16:19:22 -07:00