From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
prasad@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
mingo@elte.hu, Gautham R Shenoy <ego@in.ibm.com>,
linux-rt-users@vger.kernel.org, dipankar@in.ibm.com
Subject: Re: Markers: multi-probe locking fun (was: Re: [PATCH 0/2] Markers Implementation for RCU Tracing - Ver II)
Date: Tue, 19 Feb 2008 14:18:11 -0800 [thread overview]
Message-ID: <20080219221811.GJ10774@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080219203326.GA16701@Krystal>
On Tue, Feb 19, 2008 at 03:33:26PM -0500, Mathieu Desnoyers wrote:
> * Jan Kiszka (jan.kiszka@siemens.com) wrote:
> > Paul E. McKenney wrote:
> > > On Mon, Feb 18, 2008 at 01:47:31PM +0100, Jan Kiszka wrote:
> > >> K. Prasad wrote:
> > >>> Hi Ingo,
> > >>> Please accept these patches into the rt tree which convert the
> > >>> existing RCU tracing mechanism for Preempt RCU and RCU Boost into
> > >>> markers.
> > >>>
> > >>> These patches are based upon the 2.6.24-rc5-rt1 kernel tree.
> > >>>
> > >>> Along with marker transition, the RCU Tracing infrastructure has also
> > >>> been modularised to be built as a kernel module, thereby enabling
> > >>> runtime changes to the RCU Tracing infrastructure.
> > >>>
> > >>> Patch [1/2] - Patch that converts the Preempt RCU tracing in
> > >>> rcupreempt.c into markers.
> > >>>
> > >>> Patch [1/2] - Patch that converts the Preempt RCU Boost tracing in
> > >>> rcupreempt-boost.c into markers.
> > >>>
> > >> I have a technical problem with marker-based RCU tracing: It causes
> > >> nasty recursions with latest multi-probe marker patches (sorry, no link
> > >> at hand, can be found in latest LTTng, maybe also already in -mm). Those
> > >> patches introduce a marker probe trampoline like this:
> > >>
> > >> void marker_probe_cb(const struct marker *mdata, void *call_private,
> > >> const char *fmt, ...)
> > >> {
> > >> va_list args;
> > >> char ptype;
> > >>
> > >> /*
> > >> * rcu_read_lock does two things : disabling preemption to make sure the
> > >> * teardown of the callbacks can be done correctly when they are in
> > >> * modules and they insure RCU read coherency.
> > >> */
> > >> rcu_read_lock();
> > >> preempt_disable();
> > >> ...
> > >>
> > >> Can we do multi-probe with pure preempt_disable/enable protection? I
> > >> guess it's fine with classic RCU, but what about preemptible RCU? Any
> > >> suggestion appreciated!
> > >
> > > If you substitute synchronize_sched() for synchronize_rcu(), this should
> > > work fine. Of course, this approach would cause RCU tracing to degrade
> > > latencies somewhat in -rt.
> > >
> > > If tracing is using call_rcu(), we will need to add a call_sched()
> > > or some such.
> >
> > You mean something like "#define call_sched call_rcu_classic"?
> >
> > I just learned that there is another reason for killing
> > rcu_read_lock&friends from the marker probes: It can deadlock on -rt
> > with PREEMPT_RCU_BOOST (hit probe inside rq-lock protected region =>
> > rcu_read_unlock triggers unboost => stuck on rq_lock :( ).
> >
>
> Yep, ok, let's do this :
>
> in include/linux/rcupdate.h
>
> #ifndef PREEMPT_RT
> #define call_sched call_rcu
> #else
> #define call_sched call_rcu_classic
> #endif
>
> And I'll adapt the markers accordingly.
Good point, this will indeed work for 2.6.24-rt1!
Will need to do a bit more for 2.6.25-rc1. My current thought is to
provide a kernel thread that loops over the CPUs, advancing/invoking
per-CPU lists of callbacks as it does so. Then call_sched() would simply
enqueue its callback on the current CPU's next list.
Thanx, Paul
next prev parent reply other threads:[~2008-02-19 22:18 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-31 6:09 [PATCH 2/2] Markers Implementation for Preempt RCU Boost Tracing K. Prasad
2007-12-31 10:20 ` Ingo Molnar
2008-01-02 3:31 ` Frank Ch. Eigler
2008-01-02 12:47 ` Ingo Molnar
2008-01-02 16:33 ` Frank Ch. Eigler
2008-01-02 17:01 ` Ingo Molnar
2008-01-02 17:56 ` Frank Ch. Eigler
2008-01-02 20:10 ` Ingo Molnar
2008-01-07 18:59 ` Mathieu Desnoyers
2008-01-13 18:07 ` Pavel Machek
2008-01-14 15:35 ` Mathieu Desnoyers
2008-01-14 16:30 ` Linus Torvalds
2008-01-14 19:36 ` Mathieu Desnoyers
2008-01-02 23:49 ` Nicholas Miell
2008-01-03 19:24 ` Mathieu Desnoyers
2008-01-03 16:30 ` Mathieu Desnoyers
2008-01-04 10:58 ` Gautham R Shenoy
2008-01-05 12:46 ` Mathieu Desnoyers
2008-01-07 19:43 ` K. Prasad
2008-01-07 19:50 ` [PATCH 0/2] Markers Implementation for RCU Tracing - Ver II K. Prasad
2008-02-18 12:21 ` Jan Kiszka
2008-02-18 12:47 ` Jan Kiszka
2008-02-18 19:48 ` Paul E. McKenney
2008-02-18 20:41 ` Mathieu Desnoyers
2008-02-19 16:27 ` Markers: multi-probe locking fun (was: Re: [PATCH 0/2] Markers Implementation for RCU Tracing - Ver II) Jan Kiszka
2008-02-19 20:33 ` Mathieu Desnoyers
2008-02-19 22:18 ` Paul E. McKenney [this message]
2008-02-19 22:32 ` Mathieu Desnoyers
2008-02-19 21:54 ` Paul E. McKenney
2008-02-19 22:03 ` Mathieu Desnoyers
2008-02-19 22:19 ` Paul E. McKenney
2008-01-07 19:55 ` [PATCH 1/2] Markers Implementation for RCU Preempt Tracing - Ver II K. Prasad
2008-01-07 19:56 ` [PATCH 2/2] Markers Implementation for Preempt RCU Boost " K. Prasad
2008-01-04 12:09 ` __get_cpu_var() called from a preempt-unsafe context in __rcu_preempt_unboost() ? Gautham R Shenoy
2008-01-04 13:48 ` Steven Rostedt
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=20080219221811.GJ10774@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=dipankar@in.ibm.com \
--cc=ego@in.ibm.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@elte.hu \
--cc=prasad@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.