Skip to content

Commit b00d607

Browse files
committed
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>
1 parent a773d41 commit b00d607

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎kernel/trace/trace_stack.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip,
209209
if (__this_cpu_read(disable_stack_tracer) != 1)
210210
goto out;
211211

212+
/* If rcu is not watching, then save stack trace can fail */
213+
if (!rcu_is_watching())
214+
goto out;
215+
212216
ip += MCOUNT_INSN_SIZE;
213217

214218
check_stack(ip, &stack);

0 commit comments

Comments
 (0)