Complete removal of urcu-signal flavor This commit completes removal of the urcu-signal flavor. Users can migrate to liburcu-memb with a kernel implementing the membarrier(2) system call to have similar read-side performance without requiring use of a reserved signal, and with improved grace period performance. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I75b9171e705b9b2ef4c8eeabe6164e5587816fb4
Public headers: use SPDX identifiers The SPDX identifiers [1] are a legally binding shorthand, which can be used instead of the full boiler plate text. This is another step towards implementing the full REUSE spec [2] to help with copyright and licensing audits and compliance. This will reduce a lot a manual work required for the licensing audit required in Debian on each update. For files that lacked copyright and licensing information, I used the following guidelines. Use the author from the git history and the main project license 'LGPL-2.1-or-later'. [1] https://spdx.org/ids-how [2] https://reuse.software/tutorial/ Change-Id: I31928c81be4821cca29b905d8a0a06de9bd0e1ec Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Refactor liburcu to support many flavors per compile unit This refactoring keeps the prior use of liburcu "map" APIs unchanged. However, it introduces the following new APIs: Each urcu flavor is now available as its own header: include/urcu/urcu-memb.h include/urcu/urcu-mb.h include/urcu/urcu-signal.h include/urcu/urcu-bp.h include/urcu/urcu-qsbr.h The installed urcu headers that were not under the urcu/ subdirectory are moved there: include/urcu-call-rcu.h -> include/urcu/call-rcu.h include/urcu-defer.h -> include/urcu/defer.h include/urcu-flavor.h -> include/urcu/flavor.h include/urcu-pointer.h -> include/urcu/pointer.h include/urcu-bp.h -> include/urcu/urcu-bp.h include/urcu.h -> include/urcu/urcu.h include/urcu-qsbr.h -> include/urcu/urcu-qsbr.h The liburcu "map" API is now only available for use when URCU_API_MAP is defined before including the liburcu flavor headers. The old headers are now placeholders defining URCU_API_MAP and including the new headers for backward compatibility: include/urcu-bp.h include/urcu-call-rcu.h include/urcu-defer.h include/urcu-flavor.h include/urcu-pointer.h include/urcu-qsbr.h include/urcu.h The header include/urcu/urcu.h now includes the right header between the memb, signal, or mb flavors based on the compiler defines. The symbol names of liburcu flavors are cleaned up, favoring the following hierarchy: urcu_<flavor name>_... This is an ABI-breaking change, however the previous symbols name were kept as aliases to maintain backward compatibility. They will be removed when the next SONAME bump occurs. The new liburcu-memb.so shared object is introduced, properly namespacing this flavor. It is a duplicate of the previous liburcu.so, which is kept around for backward compatibility. The new URCU_API_MAP macro is introduced, controlling whether the urcu API "mapping" should stay defined after inclusion of the flavor headers. Users wishing to use the prior urcu API should either explicitly define URCU_API_MAP before including the urcu/urcu*.h flavor headers, or include the flavor header files from the include toplevel directory, which are placeholders for backward compatibility. Use of many urcu flavors within the same _LGPL_SOURCE compile unit should not use the "map" APIs. Internally, the "map" header files are split into one header per flavor. The include guards are removed, so their effect can be applied more than once. A new include/urcu/map/clear.h header is introduced, which undefines the mappings at the end of the flavor header if URCU_API_MAP is not set. The new APIs namespaced for each urcu flavor is the recommended way to use liburcu. We can expect the prior APIs to eventually become deprecated over time. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Allow forcing the use of sys membarrier When using the default (liburcu.so) and bulletproof (liburcu-bp.so) flavours of Userspace RCU, kernel support for sys-membarrier is detected dynamically and stored in the rcu_has_sys_membarrier_memb and urcu_bp_has_sys_membarrier global variables. Checking the value of these variables adds a small but measurable overhead to smp_mb_slave. On systems which support sys-membarrier, it would be nice to have a way of avoiding that overhead. Here is the proposed approach: if CONFIG_RCU_FORCE_SYS_MEMBARRIER is defined then rcu_has_sys_membarrier_memb/urcu_bp_has_sys_membarrier are replaced with the constant 1, eliminating the overhead in smp_mb_slave. As a sanity check, support for sys-membarrier is still detected at startup. A program using liburcu or liburcu-bp compiled with this option aborts in the library constructor if the membarrier system call is not supported by the operating system. Suggested-by: Duncan Sands <duncan.sands@deepbluecap.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>