linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: John Stultz <john.stultz@linaro.org>
Cc: paulmck@kernel.org, Josh Triplett <josh@joshtriplett.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Saravana Kannan <saravanak@google.com>,
	Todd Kjos <tkjos@google.com>, Stephen Boyd <sboyd@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: On trace_*_rcuidle functions in modules
Date: Wed, 15 Apr 2020 16:14:24 -0400	[thread overview]
Message-ID: <20200415161424.584d07d3@gandalf.local.home> (raw)
In-Reply-To: <CALAqxLV1A6sOC1GWpFYXeBoDff0+AJgoOYK7NktcTdvX3kvAeg@mail.gmail.com>

On Wed, 15 Apr 2020 12:56:52 -0700
John Stultz <john.stultz@linaro.org> wrote:

> I'm trying to enable the qcom rpmh driver
> (drivers/soc/qcom/rpmh-rsc.c) to be a module.  As I mentioned to Paul,
> it registers a cpu_pm notifier callback, which calls its
> __tcs_buffer_write() function. The trace in the __tcs_buffer_write()
> function was just converted to using rcuidle to address bugs seen when
> it was being called from idle.
> 
> > Currently, Thomas and Peter are working on removing trace events from
> > places that don't have RCU enabled, or at least cleaning up the context
> > switches from user to kernel to interrupt.  
> 
> So does that mean folks would most likely lean to trying to remove the
> tracepoint rather than reevaluating allowing the rcuidle call to be
> made from the module?
> 

No. The clean up is to try to make the switch from each context small, fast
and safe. But what you are describing is the switch to idle, which is a
different story and something that there's some talk about cleaning up, but
not at the same level. Especially if there's more complex code that is
happening with RCU watching.

Looking at the commit that keeps trace_*_rcuidle() code out:

  7ece55a4a3a04a ("trace: Don't declare trace_*_rcuidle functions in modules")

Which was added because the rcuidle variant called RCU code that was not
exported either. Which would have the same issue now as
rcu_irq_exit_irqson() is also not exported. Which would be needed.

Hmm, isn't module code itself synchronized via RCU. Then having module code
being called without RCU "watching" could be dangerous?

-- Steve

  reply	other threads:[~2020-04-15 20:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  2:20 On trace_*_rcuidle functions in modules John Stultz
2020-04-15  2:57 ` Paul E. McKenney
2020-04-15  3:47   ` John Stultz
2020-04-15 13:12     ` Paul E. McKenney
2020-04-15 12:53 ` Steven Rostedt
2020-04-15 19:56   ` John Stultz
2020-04-15 20:14     ` Steven Rostedt [this message]
2020-04-15 20:17       ` John Stultz
2020-04-15 20:41         ` Steven Rostedt
2020-04-15 21:02           ` John Stultz
2020-04-15 21:49             ` Steven Rostedt
2020-04-15 22:04               ` Paul E. McKenney
2020-04-15 22:42                 ` Peter Zijlstra
2020-04-15 22:53                   ` Steven Rostedt
2020-04-15 22:53                   ` Paul E. McKenney
2020-04-15 22:51                 ` Steven Rostedt
2020-04-15 22:54                   ` Paul E. McKenney
2020-04-16  0:06                   ` John Stultz
2020-04-16  0:48                     ` Steven Rostedt
2020-04-16  1:02                       ` Bjorn Andersson
2020-04-16  1:24                         ` Steven Rostedt
2020-04-16  2:17                       ` John Stultz
2020-04-15 22:07               ` John Stultz
2020-04-15 22:40       ` 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=20200415161424.584d07d3@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=saravanak@google.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tkjos@google.com \
    /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).