X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Frcutorture.h;h=f8548d811ed8980061716cc797a63524d97524a4;hp=aba74b0bcdadc70971af0e5e66225cfcaa034a62;hb=a5bae03d59c22e57263b8610b9fed99738303cf0;hpb=5e77fc1f94c3572fca067d37667d74f8165e2434 diff --git a/tests/rcutorture.h b/tests/rcutorture.h index aba74b0..f8548d8 100644 --- a/tests/rcutorture.h +++ b/tests/rcutorture.h @@ -56,7 +56,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (c) 2008 Paul E. McKenney, IBM Corporation. */ @@ -79,7 +79,8 @@ char argsbuf[64]; #define GOFLAG_RUN 1 #define GOFLAG_STOP 2 -int goflag __attribute__((__aligned__(CAA_CACHE_LINE_SIZE))) = GOFLAG_INIT; +volatile int goflag __attribute__((__aligned__(CAA_CACHE_LINE_SIZE))) + = GOFLAG_INIT; #define RCU_READ_RUN 1000 @@ -126,9 +127,10 @@ void *rcu_read_perf_test(void *arg) rcu_register_thread(); run_on(me); uatomic_inc(&nthreadsrunning); + put_thread_offline(); while (goflag == GOFLAG_INIT) poll(NULL, 0, 1); - mark_rcu_quiescent_state(); + put_thread_online(); while (goflag == GOFLAG_RUN) { for (i = 0; i < RCU_READ_RUN; i++) { rcu_read_lock(); @@ -156,7 +158,7 @@ void *rcu_update_perf_test(void *arg) if ((random() & 0xf00) == 0) { struct call_rcu_data *crdp; - crdp = create_call_rcu_data(0); + crdp = create_call_rcu_data(0, -1); if (crdp != NULL) { fprintf(stderr, "Using per-thread call_rcu() worker.\n"); @@ -285,9 +287,10 @@ void *rcu_read_stress_test(void *arg) int pc; rcu_register_thread(); + put_thread_offline(); while (goflag == GOFLAG_INIT) poll(NULL, 0, 1); - mark_rcu_quiescent_state(); + put_thread_online(); while (goflag == GOFLAG_RUN) { rcu_read_lock(); p = rcu_dereference(rcu_stress_current); @@ -385,7 +388,7 @@ void *rcu_fake_update_stress_test(void *arg) if ((random() & 0xf00) == 0) { struct call_rcu_data *crdp; - crdp = create_call_rcu_data(0); + crdp = create_call_rcu_data(0, -1); if (crdp != NULL) { fprintf(stderr, "Using per-thread call_rcu() worker.\n");