Run 2 writers and show single flip error case
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 23 Feb 2009 06:31:11 +0000 (01:31 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 23 Feb 2009 06:31:11 +0000 (01:31 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
formal-model/urcu/Makefile
formal-model/urcu/urcu.spin

index 0dc8b2c674945fc60990b0e0f8314de93a9cfa40..7802c7f524b27c55fe00062607174003be3bd31b 100644 (file)
@@ -26,6 +26,7 @@ default:
        make urcu_free_no_rmb | tee urcu_free_no_rmb.log
        make urcu_free_no_wmb | tee urcu_free_no_wmb.log
        make urcu_free_no_mb | tee urcu_free_no_mb.log
+       make urcu_free_single_flip | tee urcu_free_single_flip.log
        make asserts | tee asserts.log
        make summary
 
@@ -72,6 +73,13 @@ urcu_free_no_mb: clean urcu_free_ltl urcu_free_no_mb_define run
 urcu_free_no_mb_define:
        cp urcu_free_no_mb.define .input.define
 
+urcu_free_single_flip: clean urcu_free_ltl urcu_free_single_flip_define run
+       cp .input.spin $@.spin.input
+       -cp .input.spin.trail $@.spin.input.trail
+
+urcu_free_single_flip_define:
+       cp urcu_free_single_flip.define .input.define
+
 urcu_free_ltl:
        touch .input.define
        cat DEFINES > pan.ltl
index cc84e51d09d623b330664a0e8a7ca2fbb8ff97ef..7f94d3b10232b7ff91520852a65d7236238f5385 100644 (file)
@@ -21,9 +21,9 @@
 /* Promela validation variables. */
 
 #define NR_READERS 1
-#define NR_WRITERS 1
+#define NR_WRITERS 2
 
-#define NR_PROCS 2
+#define NR_PROCS 3
 
 #define get_pid()      (_pid)
 
@@ -123,6 +123,8 @@ bit free_done = 0;
 byte read_generation = 1;
 bit data_access = 0;
 
+bit write_lock = 0;
+
 inline ooo_mem(i)
 {
        atomic {
@@ -222,6 +224,13 @@ active [NR_WRITERS] proctype urcu_writer()
        }
        ooo_mem(i);
 
+       do
+       :: write_lock == 0 ->
+               write_lock = 1;
+               break;
+       :: else ->
+               skip;
+       od;
        smp_mb(i);
        ooo_mem(i);
        tmp = READ_CACHED_VAR(urcu_gp_ctr);
@@ -231,6 +240,7 @@ active [NR_WRITERS] proctype urcu_writer()
        //smp_mc(i);
        wait_for_quiescent_state(tmp, i, j);
        //smp_mc(i);
+#ifndef SINGLE_FLIP
        ooo_mem(i);
        tmp = READ_CACHED_VAR(urcu_gp_ctr);
        ooo_mem(i);
@@ -238,6 +248,7 @@ active [NR_WRITERS] proctype urcu_writer()
        //smp_mc(i);
        ooo_mem(i);
        wait_for_quiescent_state(tmp, i, j);
+#endif
        ooo_mem(i);
        smp_mb(i);
        /* free-up step, e.g., kfree(). */
@@ -245,5 +256,6 @@ active [NR_WRITERS] proctype urcu_writer()
        atomic {
                last_free_gen = old_gen;
                free_done = 1;
+               write_lock = 0;
        }
 }
This page took 0.032811 seconds and 4 git commands to generate.