X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=rcutorture.h;h=e123559103c669fcf2ceadfb673fe0616e2e0010;hp=7a19fed0e5e53fcd91665a50ba4efb7c0ed17372;hb=c97ae6eb5bf6baea503d9df98e8376c0bd36b629;hpb=8a953620d565793dcb141e673fa907cdae0a9363 diff --git a/rcutorture.h b/rcutorture.h index 7a19fed..e123559 100644 --- a/rcutorture.h +++ b/rcutorture.h @@ -112,12 +112,11 @@ 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(); + rcu_register_thread(); run_on(me); - __atomic_inc(&nthreadsrunning); + atomic_inc(&nthreadsrunning); while (goflag == GOFLAG_INIT) poll(NULL, 0, 1); mark_rcu_quiescent_state(); @@ -133,7 +132,7 @@ void *rcu_read_perf_test(void *arg) } __get_thread_var(n_reads_pt) += n_reads_local; put_thread_offline(); - urcu_unregister_thread(); + rcu_unregister_thread(); return (NULL); } @@ -142,7 +141,7 @@ void *rcu_update_perf_test(void *arg) { long long n_updates_local = 0; - __atomic_inc(&nthreadsrunning); + atomic_inc(&nthreadsrunning); while (goflag == GOFLAG_INIT) poll(NULL, 0, 1); while (goflag == GOFLAG_RUN) { @@ -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; @@ -258,7 +258,7 @@ void *rcu_read_stress_test(void *arg) struct rcu_stress *p; int pc; - urcu_register_thread(); + rcu_register_thread(); while (goflag == GOFLAG_INIT) poll(NULL, 0, 1); mark_rcu_quiescent_state(); @@ -285,7 +285,7 @@ void *rcu_read_stress_test(void *arg) } } put_thread_offline(); - urcu_unregister_thread(); + rcu_unregister_thread(); return (NULL); } @@ -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++) { @@ -392,6 +391,11 @@ int main(int argc, char *argv[]) smp_init(); //rcu_init(); +#ifdef DEBUG_YIELD + yield_active |= YIELD_READ; + yield_active |= YIELD_WRITE; +#endif + if (argc > 1) { nreaders = strtoul(argv[1], NULL, 0); if (argc == 2)