Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linux (repost)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Thursday, February 12, 2009 - 9:18 am

On Thu, Feb 12, 2009 at 12:47:07AM -0500, Mathieu Desnoyers wrote:

But the write that changes the parity will eventually make it out.
OK, so your argument is that we at least need a compiler barrier?

Regardless, please see attached for a modified version of the Promela
model that fully models omitting out the memory barrier that my
rcu_nest32.[hc] implementation omits.  (It is possible to partially
model removal of other memory barriers via #if 0, but to fully model
would need to enumerate the permutations as shown on lines 231-257.)


Assuming that the reordering is done by the CPU, the write will
eventually get out -- it is stuck in (say) the store buffer, and the
cache line will eventually arrive, and then the value will eventually
be seen by the readers.

We might need a -compiler- barrier, but then again, I am not sure that
we are talking about the same memory barrier -- again, please see
attached lines 231-257 to see which one that I eliminated.

Also, the original model I sent out has a minor bug that prevents it
from fully modeling the nested-read-side case.  The patch below fixes this.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

 urcu.spin |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/formal-model/urcu.spin b/formal-model/urcu.spin
index e5bfff3..611464b 100644
--- a/formal-model/urcu.spin
+++ b/formal-model/urcu.spin
@@ -124,9 +124,13 @@ proctype urcu_reader()
 				break;
 			:: tmp < 4 && reader_progress[tmp] != 0 ->
 				tmp = tmp + 1;
-			:: tmp >= 4 ->
+			:: tmp >= 4 &&
+			   reader_progress[0] == reader_progress[3] ->
 				done = 1;
 				break;
+			:: tmp >= 4 &&
+			   reader_progress[0] != reader_progress[3] ->
+			   	break;
 			od;
 			do
 			:: tmp < 4 && reader_progress[tmp] == 0 ->
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC git tree] Userspace RCU (urcu) for Linux, Mathieu Desnoyers, (Thu Feb 5, 8:05 pm)
[RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Thu Feb 5, 9:58 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux, Bert Wesarg, (Fri Feb 6, 1:55 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux, Mathieu Desnoyers, (Fri Feb 6, 4:36 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Fri Feb 6, 6:06 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Fri Feb 6, 9:34 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sat Feb 7, 8:10 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sat Feb 7, 3:16 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sat Feb 7, 4:38 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sat Feb 7, 4:50 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sat Feb 7, 5:13 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sat Feb 7, 5:19 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sat Feb 7, 5:44 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sun Feb 8, 2:46 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sun Feb 8, 3:36 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sun Feb 8, 3:44 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sun Feb 8, 5:24 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sun Feb 8, 5:54 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sun Feb 8, 8:42 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Sun Feb 8, 9:11 pm)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Sun Feb 8, 9:53 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Sun Feb 8, 10:17 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 12:03 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Mon Feb 9, 6:16 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 10:28 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Mon Feb 9, 10:34 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Mon Feb 9, 10:40 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Mathieu Desnoyers, (Mon Feb 9, 10:42 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Mon Feb 9, 10:59 am)
Re: [RFC git tree] Userspace RCU (urcu) for Linux (repost), Paul E. McKenney, (Mon Feb 9, 11:00 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 11:13 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 11:19 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 12:05 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Mon Feb 9, 12:15 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Tue Feb 10, 12:17 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Tue Feb 10, 2:28 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Tue Feb 10, 5:57 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Tue Feb 10, 10:28 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Tue Feb 10, 11:35 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 1:58 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 11:52 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 2:42 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 3:08 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 9:08 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 9:10 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Wed Feb 11, 10:01 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Wed Feb 11, 10:09 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Wed Feb 11, 10:47 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 12:05 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Thu Feb 12, 9:18 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 11:40 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 12:29 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 12:38 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 1:09 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 2:15 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 2:27 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Thu Feb 12, 2:53 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 5:49 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 6:12 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 8:10 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 8:55 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 10:33 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 11:40 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 11:54 am)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Fri Feb 13, 12:36 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Paul E. McKenney, (Fri Feb 13, 10:20 pm)
Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linu ..., Mathieu Desnoyers, (Fri Feb 13, 11:42 pm)