mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: kernel test robot <oliver.sang@intel.com>,
	oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Ingo Molnar <mingo@kernel.org>,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [tip:sched/core] [tracing, hardirq]  9aedeaed6f: WARNING:suspicious_RCU_usage
Date: Fri, 20 Jan 2023 10:51:18 +0100	[thread overview]
Message-ID: <Y8pkFhi32XhvCVOo@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230119112433.611fa273@gandalf.local.home>

On Thu, Jan 19, 2023 at 11:24:33AM -0500, Steven Rostedt wrote:
> On Thu, 19 Jan 2023 16:45:49 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > Steve, what's the easiest way to figure out what triggers this? Put a
> > printk() in prepare_ftrace_return() or so?
> 
> Does it only trigger if all functions are enabled when running function
> graph tracer?
> 
> That is, if you just trace one function, say "schedule" does it
> have an issue?
> 
>  trace-cmd start -p function_graph -l schedule
> 
> And then run your code, and it doesn't trigger, but:
> 
> 
>  trace-cmd reset # make sure schedule is no longer filtered
>  trace-cmd start -p function_graph
> 
> does trigger the issue, you can then bisect the functions with the script:
> 
>   scripts/tracing/ftrace-bisect.sh

Pff, that all sounds like actual work :-)

Instead I did me the below hack and added my early_printk() hacks and
that got me a usable backtrace.

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 5e7ead52cfdb..7defc6e24f8f 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -646,6 +646,9 @@ void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
 	if (unlikely(atomic_read(&current->tracing_graph_pause)))
 		return;
 
+	if (WARN_ONCE(!rcu_is_watching(), "RCU not on for: %pS\n", (void *)ip))
+		return;
+
 	bit = ftrace_test_recursion_trylock(ip, *parent);
 	if (bit < 0)
 		return;

  reply	other threads:[~2023-01-20  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 14:06 kernel test robot
2023-01-19 15:45 ` Peter Zijlstra
2023-01-19 16:24   ` Steven Rostedt
2023-01-20  9:51     ` Peter Zijlstra [this message]
2023-01-21 16:49       ` Steven Rostedt
2023-01-31 14:22 ` [tip: sched/core] cpuidle: Fix poll_idle() noinstr annotation tip-bot2 for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8pkFhi32XhvCVOo@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mingo@kernel.org \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®