From: Joel Fernandes <joel@joelfernandes.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Ingo Molnar <mingo@redhat.com>,
Richard Fontana <rfontana@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
paulmck <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Subject: Re: [RFC 0/3] Revert SRCU from tracepoint infrastructure
Date: Mon, 10 Feb 2020 15:30:08 -0500 [thread overview]
Message-ID: <20200210203008.GA84085@google.com> (raw)
In-Reply-To: <20200210150348.7d0979e6@gandalf.local.home>
Hi Steve,
On Mon, Feb 10, 2020 at 03:03:48PM -0500, Steven Rostedt wrote:
> On Mon, 10 Feb 2020 14:53:02 -0500
> Joel Fernandes <joel@joelfernandes.org> wrote:
>
> > > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> > > index 1fb11daa5c53..a83fd076a312 100644
> > > --- a/include/linux/tracepoint.h
> > > +++ b/include/linux/tracepoint.h
> > > @@ -179,10 +179,8 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
> > > * For rcuidle callers, use srcu since sched-rcu \
> > > * doesn't work from the idle path. \
> > > */ \
> > > - if (rcuidle) { \
> > > + if (rcuidle) \
> > > __idx = srcu_read_lock_notrace(&tracepoint_srcu);\
> > > - rcu_irq_enter_irqson(); \
> > > - } \
> >
> > This would still break out-of-tree modules or future code that does
> > rcu_read_lock() right in a tracepoint callback right?
>
> Yes, and that's fine.
>
> >
> > Or are we saying that rcu_read_lock() in a tracepoint callback is not
> > allowed? I believe this should then at least be documented somewhere. Also,
>
> No, it's only not allowed if you you attached to a tracepoint that can
> be called without rcu watching. That's up to the caller to figure it
> out. Tracepoints were never meant to be a generic thing people should
> use without knowing what they are really doing.
Ok, right.
> > what about code in tracepoint callback that calls rcu_read_lock() indirectly
> > through a path in the kernel, and also code that may expect RCU readers when
> > doing preempt_disable()?
>
> Then they need to know what they are doing.
Ok.
> > So basically we are saying with this patch:
> > 1. Don't call in a callback: rcu_read_lock() or preempt_disable() and expect RCU to do
> > anything for you.
>
> We can just say, "If you plan on using RCU, be aware that it man not be
> watching and you get do deal with the fallout. Use rcu_is_watching() to
> figure it out."
Ok.
> > 2. Don't call code that does anything that 1. needs.
> >
> > Is that intended? thanks,
> >
>
> No, look what the patch did for perf. Why make *all* callbacks suffer
> if only some use RCU? If you use RCU from a callback, then you need to
> figure it out. The same goes for attaching to the function tracer.
Only the callbacks on the rcuidle ones would suffer though, not all
callbacks.
Yes I saw the patch, it looks like a good idea to me and I am Ok with it.
thanks,
- Joel
next prev parent reply other threads:[~2020-02-10 20:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 20:56 [RFC 0/3] Revert SRCU from tracepoint infrastructure Joel Fernandes (Google)
2020-02-07 20:56 ` [RFC 1/3] Revert "tracepoint: Use __idx instead of idx in DO_TRACE macro to make it unique" Joel Fernandes (Google)
2020-02-07 21:07 ` Steven Rostedt
2020-02-07 20:56 ` [RFC 2/3] Revert "tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints" Joel Fernandes (Google)
2020-02-07 20:56 ` [RFC 3/3] Revert "tracepoint: Make rcuidle tracepoint callers use SRCU" Joel Fernandes (Google)
2020-02-07 21:24 ` [RFC 0/3] Revert SRCU from tracepoint infrastructure Paul E. McKenney
2020-02-07 21:43 ` Joel Fernandes
2020-02-08 16:39 ` Mathieu Desnoyers
2020-02-08 16:31 ` Mathieu Desnoyers
2020-02-10 9:46 ` Peter Zijlstra
2020-02-10 10:19 ` Peter Zijlstra
2020-02-10 13:36 ` Paul E. McKenney
2020-02-10 13:44 ` Peter Zijlstra
2020-02-10 13:57 ` Paul E. McKenney
2020-02-10 17:17 ` Joel Fernandes
2020-02-10 17:05 ` Steven Rostedt
2020-02-10 17:33 ` Mathieu Desnoyers
2020-02-10 18:30 ` Steven Rostedt
2020-02-10 19:05 ` Mathieu Desnoyers
2020-02-10 19:53 ` Joel Fernandes
2020-02-10 20:03 ` Steven Rostedt
2020-02-10 20:30 ` Joel Fernandes [this message]
2020-02-10 18:07 ` Paul E. McKenney
2020-02-10 16:59 ` Joel Fernandes
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=20200210203008.GA84085@google.com \
--to=joel@joelfernandes.org \
--cc=arnaldo.melo@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rfontana@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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).