Fix warnings in urcutorture and use access once in urch.u
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Feb 2009 18:29:18 +0000 (13:29 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 12 Feb 2009 18:29:18 +0000 (13:29 -0500)
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
rcutorture.h
urcu.h

index bda2ad575cdcb86b34ab5a100e49cffae96d1685..8ba67637ae8927ee6b64487941ef7ba743287a92 100644 (file)
@@ -112,7 +112,6 @@ void *rcu_read_perf_test(void *arg)
 {
        int i;
        int me = (long)arg;
-       cpu_set_t mask;
        long long n_reads_local = 0;
 
        urcu_register_thread();
@@ -150,6 +149,7 @@ void *rcu_update_perf_test(void *arg)
                n_updates_local++;
        }
        __get_thread_var(n_updates_pt) += n_updates_local;
+       return NULL;
 }
 
 void perftestinit(void)
@@ -242,7 +242,7 @@ struct rcu_stress {
        int mbtest;
 };
 
-struct rcu_stress rcu_stress_array[RCU_STRESS_PIPE_LEN] = { 0 };
+struct rcu_stress rcu_stress_array[RCU_STRESS_PIPE_LEN] = { { 0 } };
 struct rcu_stress *rcu_stress_current;
 int rcu_stress_idx = 0;
 
@@ -314,19 +314,18 @@ void *rcu_update_stress_test(void *arg)
                synchronize_rcu();
                n_updates++;
        }
+       return NULL;
 }
 
 void *rcu_fake_update_stress_test(void *arg)
 {
-       int i;
-       struct rcu_stress *p;
-
        while (goflag == GOFLAG_INIT)
                poll(NULL, 0, 1);
        while (goflag == GOFLAG_RUN) {
                synchronize_rcu();
                poll(NULL, 0, 1);
        }
+       return NULL;
 }
 
 void stresstest(int nreaders)
@@ -360,7 +359,7 @@ void stresstest(int nreaders)
        wait_all_threads();
        for_each_thread(t)
                n_reads += per_thread(n_reads_pt, t);
-       printf("n_reads: %lld  n_updates: %ld  n_mberror: %ld\n",
+       printf("n_reads: %lld  n_updates: %ld  n_mberror: %d\n",
               n_reads, n_updates, n_mberror);
        printf("rcu_stress_count:");
        for (i = 0; i <= RCU_STRESS_PIPE_LEN; i++) {
diff --git a/urcu.h b/urcu.h
index 3eca5ea3c44ccc7135635229c41141d5050df1e2..79d9464b0be63142fb51cb2f00d11edb5996441d 100644 (file)
--- a/urcu.h
+++ b/urcu.h
@@ -244,7 +244,7 @@ static inline void rcu_read_lock(void)
        /* The data dependency "read urcu_gp_ctr, write urcu_active_readers",
         * serializes those two memory operations. */
        if (likely(!(tmp & RCU_GP_CTR_NEST_MASK)))
-               urcu_active_readers = urcu_gp_ctr;
+               urcu_active_readers = ACCESS_ONCE(urcu_gp_ctr);
        else
                urcu_active_readers = tmp + RCU_GP_COUNT;
        /*
This page took 0.030509 seconds and 4 git commands to generate.