From: Joe Korty <joe.korty@ccur.com>
To: paulmck@linux.vnet.ibm.com
Cc: fweisbec@gmail.com, peterz@infradead.org, laijs@cn.fujitsu.com,
mathieu.desnoyers@efficios.com, dhowells@redhat.com,
loic.minier@linaro.org, dhaval.giani@gmail.com,
tglx@linutronix.de, josh@joshtriplett.org,
houston.jim@comcast.net, andi@firstfloor.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 8/9] jrcu: fix broken rcu_barrier
Date: Sun, 13 Mar 2011 23:50:44 -0400 [thread overview]
Message-ID: <20110314035044.GA12990@tsunami.ccur.com> (raw)
jrcu: fix bug in rcu_barrier.
It is not equivalent to synchronize_rcu. But it
can be implemented by a pair of synchronize_rcu's,
so do so.
Thanks go to Paul E McKenney for finding this.
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Index: b/kernel/jrcu.c
===================================================================
--- a/kernel/jrcu.c
+++ b/kernel/jrcu.c
@@ -183,7 +183,7 @@ void rcu_note_might_resched(void)
}
EXPORT_SYMBOL(rcu_note_might_resched);
-void rcu_barrier(void)
+void synchronize_sched(void)
{
struct rcu_synchronize rcu;
@@ -196,6 +196,13 @@ void rcu_barrier(void)
atomic_inc(&rcu_stats.nbarriers);
}
+EXPORT_SYMBOL_GPL(synchronize_sched);
+
+void rcu_barrier(void)
+{
+ synchronize_sched();
+ synchronize_sched();
+}
EXPORT_SYMBOL_GPL(rcu_barrier);
void rcu_force_quiescent_state(void)
Index: b/include/linux/jrcu.h
===================================================================
--- a/include/linux/jrcu.h
+++ b/include/linux/jrcu.h
@@ -39,12 +39,13 @@ extern void rcu_barrier(void);
#define rcu_barrier_sched rcu_barrier
#define rcu_barrier_bh rcu_barrier
-#define synchronize_rcu rcu_barrier
-#define synchronize_sched rcu_barrier
-#define synchronize_sched_expedited rcu_barrier
-#define synchronize_rcu_bh rcu_barrier
-#define synchronize_rcu_expedited rcu_barrier
-#define synchronize_rcu_bh_expedited rcu_barrier
+extern void synchronize_sched(void);
+
+#define synchronize_rcu synchronize_sched
+#define synchronize_sched_expedited synchronize_sched
+#define synchronize_rcu_bh synchronize_sched
+#define synchronize_rcu_expedited synchronize_sched
+#define synchronize_rcu_bh_expedited synchronize_sched
#define rcu_init(cpu) do { } while (0)
#define rcu_init_sched() do { } while (0)
next reply other threads:[~2011-03-14 3:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 3:50 Joe Korty [this message]
2011-03-14 8:47 ` [PATCH 8/9] jrcu: fix broken rcu_barrier Paul E. McKenney
2011-03-14 22:09 ` Joe Korty
2011-03-23 6:35 ` Paul E. McKenney
2011-03-23 13:46 ` Joe Korty
2011-03-24 0:23 ` 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=20110314035044.GA12990@tsunami.ccur.com \
--to=joe.korty@ccur.com \
--cc=andi@firstfloor.org \
--cc=dhaval.giani@gmail.com \
--cc=dhowells@redhat.com \
--cc=fweisbec@gmail.com \
--cc=houston.jim@comcast.net \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.minier@linaro.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.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