tests: split in check, regtest and bench targets Allow make check to run without requiring build machines to use hours of CPU time. make check: short unit tests make regtest: long regression tests make bench: long benchmarks Fixes #611 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add rcu_read_ongoing() API to each urcu flavor This will allow checking whether: - thread is online (QSBR), - thread is nested within read-side critical section (other flavors), This is useful for libraries that need to know if QSBR is online in order to save the original state temporarily so it can be restored before returning to the caller. Eventually, this API can be called by a "debugging" implementation of rcu_dereference() and other urcu-pointer.h API members to check that no RCU pointer is read outside of RCU read-side critical sections. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix tests: finer-grained use of CPU_SET, CPU_ZERO and cpu_set_t Noticed build failure at https://buildd.debian.org/status/package.php?p=liburcu : Tail of log for liburcu on hurd-i386: test_urcu.c:110:0: warning: "CPU_SET" redefined [enabled by default] In file included from /usr/include/pthread/pthread.h:50:0, from /usr/include/pthread.h:2, from test_urcu.c:26: /usr/include/sched.h:80:0: note: this is the location of the previous definition make[3]: *** [test_urcu.o] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all] Error 2 dh_auto_build: make -j1 returned exit code 2 make: *** [build-arch] Error 2 dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2 make[3]: Entering directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/liburcu-0.7.6/tests' CC test_urcu.o make[3]: Leaving directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/liburcu-0.7.6/tests' make[2]: Leaving directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/liburcu-0.7.6' Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests: use standard malloc/free for synchronize_rcu() Allows removing mutex from tests, which allow testing scalability of concurrent synchronize_rcu() executions. CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com> CC: Lai Jiangshan <laijs@cn.fujitsu.com> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: cast pthread_self() return value to unsigned long pthread_t can map to other things that unsigned long (e.g. pointer). Cast it to unsigned long for debug printing and for debug delay random value purposes. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix static linking: fix symbol name namespaces gp_futex, yield_active, rand_yield, has_sys_membarrier, rcu_defer_exit, call_rcu_data_free, call_rcu_before_fork, call_rcu_after_fork_parent, call_rcu_after_fork_child are exported by each urcu flavor. In order to fix use-cases where multiple flavors are statically linked into the same application, we need to move these symbols to local namespaces. Ensure that all symbols are prefixed by "rcu_". Also add each of those symbols into urcu/map/*.h headers, so they get mapped to their flavor-specific symbol name by the preprocessor. This requires bumping our .so version from 1.0.0 to 2.0.0, because it changes some symbol names. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu tests: hold mutex across use of custom allocator A thread preempted for a long period of time could race, when scheduled again, with another thread that would have been allocating/freeing entries (thus wrapping-around the available buffer), which would trigger this race only when overcommitting the number of threads compared to the number of available CPUs. Taking the mutex across alloc and free to fix this. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
userspace-rcu tests: zero array before using It seems like we need the test arrays to start out zeroed. Without this patch, I get errors like this when running the tests: test_urcu: test_urcu.c:201: test_array_alloc: Assertion `test_array[index].a == 0xDEADBEEF || test_array[index].a == 0' failed. Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Rename all arch primitives with prefix caa_ This is the second patch for reducing namespace pollution. The caa_ prefix stands for Concurrent Architecture Abstraction. Again, suggested by Mathieu Desnoyers and Paul E. Mckenney. Every define, macro and function specific to the architecture abstraction of liburcu is modified with that prefix Signed-off-by: David Goulet <david.goulet@polymtl.ca> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Rename all memory primitives with prefix cmm_ In order to not pollute the userspace namespace for application using liburcu or any lib/apps linked with urcu, this patch if the first of three major refactor for naming convention. The cmm_ prefix is a short name for Concurrent Memory Model and was suggested by Mathieu Desnoyers and Paul E. Mckenney. Every memory primitives such as mb, wmb, rmb, and so on are renamed. Signed-off-by: David Goulet <david.goulet@polymtl.ca> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>