summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3019378)
A bug was introduced when moving from statically assigning the parity to wait
for on the update side (first even, then odd) to a model trying to deal the
single flip test case. It occurs that when busy-looping, the parity flip
occurred when it should not.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
-#define smp_mb_send smp_mb
+#define smp_mb_send(i, j, progressid) smp_mb(i, j)
#define smp_mb_reader smp_mb
#define smp_mb_recv(i, j)
#define smp_mb_reader smp_mb
#define smp_mb_recv(i, j)
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_READ_GP);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WRITE_GP);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_READ_GP);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WRITE_GP);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT);
+ /* For single flip, we need to know the current parity */
+ cur_gp_val = cur_gp_val ^ RCU_GP_CTR_BIT;
ooo_mem(i);
/* ONLY WAITING FOR READER 0 */
tmp2 = READ_CACHED_VAR(urcu_active_readers[0]);
ooo_mem(i);
/* ONLY WAITING FOR READER 0 */
tmp2 = READ_CACHED_VAR(urcu_active_readers[0]);
- cur_gp_val = cur_gp_val ^ RCU_GP_CTR_BIT;
+#ifndef SINGLE_FLIP
+ /* In normal execution, we are always starting by
+ * waiting for the even parity.
+ */
+ cur_gp_val = RCU_GP_CTR_BIT;
+#endif
if
:: (tmp2 & RCU_GP_CTR_NEST_MASK)
&& ((tmp2 ^ cur_gp_val) & RCU_GP_CTR_BIT) ->
if
:: (tmp2 & RCU_GP_CTR_NEST_MASK)
&& ((tmp2 ^ cur_gp_val) & RCU_GP_CTR_BIT) ->
ooo_mem(i);
/* ONLY WAITING FOR READER 0 */
tmp2 = READ_CACHED_VAR(urcu_active_readers[0]);
ooo_mem(i);
/* ONLY WAITING FOR READER 0 */
tmp2 = READ_CACHED_VAR(urcu_active_readers[0]);
- cur_gp_val = cur_gp_val ^ RCU_GP_CTR_BIT;
if
:: (tmp2 & RCU_GP_CTR_NEST_MASK)
if
:: (tmp2 & RCU_GP_CTR_NEST_MASK)
- && ((tmp2 ^ cur_gp_val) & RCU_GP_CTR_BIT) ->
+ && ((tmp2 ^ 0) & RCU_GP_CTR_BIT) ->
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT_LOOP);
:: else ->
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT);
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT_LOOP);
:: else ->
PRODUCE_TOKENS(proc_urcu_writer, WRITE_PROC_SECOND_WAIT);