da25a672cf
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:
|
||
---|---|---|
.. | ||
blktrace.c | ||
bpf_trace.c | ||
ftrace.c | ||
Kconfig | ||
Makefile | ||
power-traces.c | ||
preemptirq_delay_test.c | ||
ring_buffer.c | ||
ring_buffer_benchmark.c | ||
rpm-traces.c | ||
trace.c | ||
trace.h | ||
trace_benchmark.c | ||
trace_benchmark.h | ||
trace_branch.c | ||
trace_clock.c | ||
trace_entries.h | ||
trace_event_perf.c | ||
trace_events.c | ||
trace_events_filter.c | ||
trace_events_filter_test.h | ||
trace_events_hist.c | ||
trace_events_trigger.c | ||
trace_export.c | ||
trace_functions.c | ||
trace_functions_graph.c | ||
trace_hwlat.c | ||
trace_irqsoff.c | ||
trace_kdb.c | ||
trace_kprobe.c | ||
trace_kprobe_selftest.c | ||
trace_kprobe_selftest.h | ||
trace_mmiotrace.c | ||
trace_nop.c | ||
trace_output.c | ||
trace_output.h | ||
trace_preemptirq.c | ||
trace_printk.c | ||
trace_probe.c | ||
trace_probe.h | ||
trace_sched_switch.c | ||
trace_sched_wakeup.c | ||
trace_selftest.c | ||
trace_selftest_dynamic.c | ||
trace_seq.c | ||
trace_stack.c | ||
trace_stat.c | ||
trace_stat.h | ||
trace_syscalls.c | ||
trace_uprobe.c | ||
tracing_map.c | ||
tracing_map.h |