Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: membarrier fallback symbol conflict * Lai Jiangshan (laijs@cn.fujitsu.com) wrote: > Hi, Mathieu, > > There is a big compatible problem in URCU which should be fix in next round. > > LB: liburcu built on the system which has sys_membarrier(). > LU: liburcu built on the system which does NOT have sys_membarrier(). > > LBM: liburcu-mb .... > LUM: liburcu-mb ... > > AB: application(-lliburcu) built on the system which has sys_membarrier(). > AU: application(-lliburcu) built on the system which does NOT have > sys_membarrier(). > > ABM application(-lliburcu-mb) ... > AUM application(-lliburcu-mb) ... > > AB/AU + LB/LU: 4 combinations > ABM/AUM + LBM/LUM: 4 combinations > > I remember some of the 8 combinations can't works due to symbols are > miss match. only LU+AB and LB+AU ? > > could you check it? > > How to fix it: In LU and AU, keep all the symbol name/ABI as LA and > AB, but only the behaviors falls back to URCU_MB. Define membarrier() as -ENOSYS when SYS_membarrier is not found in the system headers. Check dynamically for membarrier availability to ensure ABI compatibility between applications and librairies. Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com> 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 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>
Revert "Create per RCU flavor CDS libraries" This reverts commit d4b99c015229978810319cfd42e1c9763772fad8. Minor change (not visible to end-users): this commit introduces a liburcu-common.so to hold wfqueue, wfstack and futex fall-back code. This .so is used by all URCU flavors, as well as liburcu-cds.so. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Create per RCU flavor CDS libraries Introduce per-flavor concurrent data structure libraries for data structures depending on RCU: liburcu-cds: memb flavor (default), matches -lurcu liburcu-cds-qsbr: qsbr flavor, matches -lurcu-qsbr liburcu-cds-mb: mb flavor, matches -lurcu-mb liburcu-cds-signal, matches -lurcu-signal liburcu-cds-bp, matches -lurcu-bp liburcu-cds-common: Data structures not depending on RCU for synchronization. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix choice of default flavour in urcu/map/urcu.h Hi, I noticed in the 0.64 release (and git too) that if a flavour is not specified explicitly then RCU_MB is chosen in urcu/map/urcu.h, while the docs say and the Makefile expects RCU_MEMBARRIER. Note that the header file urcu/static/urcu.h has similar logic but uses RCU_MEMBARRIER for the default. Before this patch: $ nm *.a | grep rcu_init 00000000000003c0 T rcu_init_mb 00000000000003c0 T rcu_init_mb 0000000000000000 T rcu_init_sig After this patch: $ nm *.a | grep rcu_init 00000000000003c0 T rcu_init_memb 00000000000003c0 T rcu_init_mb 0000000000000000 T rcu_init_sig Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>