From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: "Joel Fernandes, Google" <joel@joelfernandes.org>
Cc: paulmck <paulmck@kernel.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>,
rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Josh Triplett <josh@joshtriplett.org>,
Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [RFC 0/3] Revert SRCU from tracepoint infrastructure
Date: Sat, 8 Feb 2020 11:39:33 -0500 (EST) [thread overview]
Message-ID: <898571880.615459.1581179973560.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20200207214357.GA75841@google.com>
----- On Feb 7, 2020, at 4:43 PM, Joel Fernandes, Google joel@joelfernandes.org wrote:
> On Fri, Feb 07, 2020 at 01:24:50PM -0800, Paul E. McKenney wrote:
>> On Fri, Feb 07, 2020 at 03:56:53PM -0500, Joel Fernandes (Google) wrote:
>> > Hi,
>> > These patches remove SRCU usage from tracepoints. The reason for proposing the
>> > reverts is because the whole point of SRCU was to avoid having to call
>> > rcu_irq_enter_irqson(). However this was added back in 865e63b04e9b2 ("tracing:
>> > Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints") because perf
>> > was breaking..
>> >
>> > Further it occurs to me that, by using SRCU for tracepoints, we forgot that RCU
>> > is not really watching the tracepoint callbacks. This means that anyone doing
>> > preempt_disable() in their tracepoint callback, and expecting RCU to listen to
>> > them is in for a big surprise. When RCU is not watching, it does not care about
>> > preempt-disable sections on CPUs as you can see in the forced-quiescent state
>> > loop.
>> >
>> > Since SRCU is not providing any benefit because of 865e63b04e9b2 anyway, let us
>> > revert SRCU tracepoint code to maintain the sanity of potential
>> > tracepoint callback registerers.
>>
>> For whatever it is worth, SRCU is the exception to the "RCU needs to
>> be watching" rule. You can have SRCU readers on idle CPUs, offline
>> CPUs, CPUs executing in userspace, whatever.
>
> Yes sure. My concern was that callbacks are still using regular RCU somewhere
> and RCU isn't watching. I believe BPF is using RCU that way (not sure). But
> could be other out-of-tree kernel modules etc.
Tracepoint users should issue "tracepoint_synchronize_unregister()" rather than
expect tracepoints to rely on RCU.
I cannot find a good reason for perf to issue a redundant rcu_read_lock/unlock from
a tracepoint probe already providing RCU or SRCU synchronization. Same goes for BPF.
If they _really_ need to do it, then they could implement their own idle probes
which do an additional rcu_irq_enter/exit_irqson(), but this work-around does not
belong in tracepoint.h.
If out-of-tree modules fail to use the API properly, the burden of getting fixed
is on their shoulders, as it has always been.
Thanks,
Mathieu
>
> thanks,
>
> - Joel
>
>>
>> Thanx, Paul
>>
>> > Joel Fernandes (Google) (3):
>> > Revert "tracepoint: Use __idx instead of idx in DO_TRACE macro to make
>> > it unique"
>> > Revert "tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle
>> > tracepoints"
>> > Revert "tracepoint: Make rcuidle tracepoint callers use SRCU"
>> >
>> > include/linux/tracepoint.h | 40 ++++++--------------------------------
>> > kernel/tracepoint.c | 10 +---------
>> > 2 files changed, 7 insertions(+), 43 deletions(-)
>> >
>> > --
>> > 2.25.0.341.g760bfbb309-goog
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2020-02-08 16:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 20:56 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 [this message]
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
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=898571880.615459.1581179973560.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.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
Powered by JetHome