From: Mathieu Desnoyers Date: Sat, 3 Sep 2011 19:24:25 +0000 (-0400) Subject: rculfhash: benchmark QSBR flavor X-Git-Tag: v0.7.0~43^2~183 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5567839e38c20a97960b6472bddbfd7eb6d9bc40;p=urcu.git rculfhash: benchmark QSBR flavor Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/Makefile.am b/tests/Makefile.am index d32088b..9e5940f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -176,8 +176,8 @@ test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_wfs_dynlink_LDADD = $(URCU_COMMON_LIB) test_urcu_hash_SOURCES = test_urcu_hash.c $(COMPAT) -test_urcu_hash_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS) -test_urcu_hash_LDADD = $(URCU) $(URCU_CDS_LIB) +test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS) +test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_CDS_LIB) urcutorture.c: api.h diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index be0eaf4..ffd8e2f 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -66,7 +66,7 @@ static inline pid_t gettid(void) #else #define debug_yield_read() #endif -#include +#include #include #include @@ -369,6 +369,8 @@ void *thr_reader(void *_count) nr_reads++; if (unlikely(!test_duration_read())) break; + if (unlikely((nr_reads & ((1 << 10) - 1)) == 0)) + rcu_quiescent_state(); } rcu_unregister_thread(); @@ -459,6 +461,8 @@ void *thr_writer(void *_count) break; if (unlikely(wdelay)) loop_sleep(wdelay); + if (unlikely((nr_writes & ((1 << 10) - 1)) == 0)) + rcu_quiescent_state(); } rcu_unregister_thread();