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
..
2017-11-27 12:03:58 -07:00
2018-06-04 21:52:26 +02:00
2018-08-01 21:15:31 -04:00
2018-07-31 11:32:27 -04:00
2018-07-31 11:32:27 -04:00
2017-11-02 11:10:55 +01:00
2018-07-27 17:58:34 -04:00
2017-08-02 14:23:02 -04:00
2018-08-01 21:09:50 -04:00
2017-11-02 11:10:55 +01:00
2018-05-15 10:27:29 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-06 08:56:52 -04:00
2018-05-29 08:28:53 -04:00
2018-04-10 07:33:10 +02:00
2017-11-02 11:10:55 +01:00
2018-07-03 18:14:40 -04:00
2018-07-03 18:14:39 -04:00
2018-07-26 10:50:18 -04:00
2018-08-03 09:38:39 -04:00
2018-05-29 08:28:53 -04:00
2018-07-03 18:47:11 -04:00
2018-01-23 15:57:00 -05:00
2018-08-01 16:06:02 -04:00
2018-07-31 11:32:27 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 18:41:04 -04:00
2018-07-30 18:41:04 -04:00
2018-08-02 12:34:41 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-12 19:56:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-31 11:32:27 -04:00
2018-03-26 11:13:09 +02:00
2018-03-23 12:02:37 -04:00
2018-03-29 16:03:48 +02:00
2017-11-02 11:10:55 +01:00
2017-11-08 10:17:15 +01:00
2018-01-23 15:57:29 -05:00
2017-11-17 14:58:01 -08:00
2018-05-03 11:58:05 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-17 14:58:01 -08:00
2018-05-24 18:18:19 -07:00
2018-08-01 16:08:57 -04:00
2018-08-01 16:08:57 -04:00
2018-06-12 16:19:22 -07:00
2018-03-10 16:05:53 -05:00