diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-12-05 04:41:51 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-12-14 20:48:22 -0500 |
commit | b00d607bb188e187c7b60074d2fa91a6f1985029 (patch) | |
tree | d316d0fbc4cbd906f38d3f4e2d1a2502f4439988 /kernel/trace | |
parent | a773d419275bf54854ca6cfda8f2594ed2790faa (diff) | |
download | linux-stable-b00d607bb188e187c7b60074d2fa91a6f1985029.tar.gz linux-stable-b00d607bb188e187c7b60074d2fa91a6f1985029.tar.bz2 linux-stable-b00d607bb188e187c7b60074d2fa91a6f1985029.zip |
tracing: Have stack trace not record if RCU is not watching
The stack tracer records a stack dump whenever it sees a stack usage that is
more than what it ever saw before. This can happen at any function that is
being traced. If it happens when the CPU is going idle (or other strange
locations), RCU may not be watching, and in this case, the recording of the
stack trace will trigger a warning. There's been lots of efforts to make
hacks to allow stack tracing to proceed even if RCU is not watching, but
this only causes more issues to appear. Simply do not trace a stack if RCU
is not watching. It probably isn't a bad stack anyway.
Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_stack.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 734accc02418..3c7bfc4bf5e9 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -209,6 +209,10 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip, if (__this_cpu_read(disable_stack_tracer) != 1) goto out; + /* If rcu is not watching, then save stack trace can fail */ + if (!rcu_is_watching()) + goto out; + ip += MCOUNT_INSN_SIZE; check_stack(ip, &stack); |