From: Steven Rostedt <rostedt@goodmis.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up
Date: Thu, 15 Dec 2022 13:51:02 -0500 [thread overview]
Message-ID: <20221215135102.556ee076@gandalf.local.home> (raw)
In-Reply-To: <20221215170256.GG4001@paulmck-ThinkPad-P17-Gen-1>
On Thu, 15 Dec 2022 09:02:56 -0800
"Paul E. McKenney" <paulmck@kernel.org> wrote:
> On Thu, Dec 15, 2022 at 10:02:41AM -0500, Steven Rostedt wrote:
> > On Wed, 14 Dec 2022 12:03:33 -0800
> > "Paul E. McKenney" <paulmck@kernel.org> wrote:
> >
> > > > > Avoid calling the synchronization function when system_state is
> > > > > SYSTEM_BOOTING.
> > > >
> > > > Shouldn't this be done inside tracepoint_synchronize_unregister()?
> > > > Then, it will prevent similar warnings if we expand boot time feature.
> > >
> > > How about the following wide-spectrum fix within RCU_LOCKDEP_WARN()?
> > > Just in case there are ever additional issues of this sort?
> >
> > Adding more tracing command line parameters is triggering this more. I now
> > hit:
>
> Fair point, and apologies for the hassle.
>
> Any chance of getting an official "it is now late enough in boot to
> safely invoke lockdep" API? ;-)
lockdep API isn't the problem, it's that we are still in the earlyboot stage
where interrupts are disabled, and you can't enable them. Lockdep works
just fine there, and is reporting interrupts being disabled correctly. The
backtrace reported *does* have interrupts disabled.
The thing is, because we are still running on a single CPU with interrupts
disabled, there is no need for synchronization. Even grabbing a mutex is
safe because there's guaranteed to be no contention (unless it's not
released). This is why a lot of warnings are suppressed if system_state is
SYSTEM_BOOTING.
>
> In the meantime, does the (untested and quite crude) patch at the end
> of this message help?
I'll go and test it, but I'm guessing it will work fine. You could also test
against system_state != SYSTEM_BOOTING, as that gets cleared just before
kernel_init() can continue (it waits for the complete() that is called
after system_state is set to SYSTEM_SCHEDULING). Which happens shortly
after rcu_scheduler_starting().
I wonder if you could even replace RCU_SCHEDULER_RUNNING with
system_state != SYSTEM_BOOTING, and remove the rcu_scheduler_starting()
call.
-- Steve
next prev parent reply other threads:[~2022-12-15 18:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 22:24 [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up Steven Rostedt
2022-12-13 23:49 ` Masami Hiramatsu
2022-12-14 0:03 ` Steven Rostedt
2022-12-14 7:31 ` Masami Hiramatsu
2022-12-14 20:03 ` Paul E. McKenney
2022-12-14 20:37 ` Mathieu Desnoyers
2022-12-14 21:26 ` Paul E. McKenney
2022-12-15 15:02 ` Steven Rostedt
2022-12-15 17:02 ` Paul E. McKenney
2022-12-15 17:25 ` Paul E. McKenney
2022-12-15 18:51 ` Steven Rostedt [this message]
2022-12-15 19:01 ` Paul E. McKenney
2022-12-15 22:39 ` Steven Rostedt
2022-12-15 23:10 ` Paul E. McKenney
2022-12-15 23:42 ` Steven Rostedt
2022-12-16 1:01 ` Paul E. McKenney
2022-12-16 4:40 ` Paul E. McKenney
2022-12-16 11:08 ` Steven Rostedt
2022-12-18 0:29 ` Paul E. McKenney
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=20221215135102.556ee076@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=paulmck@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;
as well as URLs for NNTP newsgroup(s).