tests: Use uatomic for accessing global states Global states accesses were protected via memory barriers. Use the uatomic API with the CMM memory model so that TSAN does not warn about non-atomic concurrent accesses. Also, the thread id map mutex must be unlocked after setting the new created thread id in the map. Otherwise, the new thread could observe an unset id. Change-Id: I1ecdc387b3f510621cbc116ad3b95c676f5d659a Co-authored-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Olivier Dion <odion@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests: 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 test scripts license as stated in LICENSE, 'GPL-2.0-only'. [1] https://spdx.org/ids-how [2] https://reuse.software/tutorial/ Change-Id: I23c23edeffe6f3448ad673034480de46c98b746b Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Build and run regression and unit tests as C++ programs Build and run all tests under tests/regression and tests/unit as C++ programs in addition to C. This helps get confidence that urcu, when used from a C++ program, behaves well. Change-Id: Iacaa42dddbcbf59eff8e327edfd0352cce0b74b7 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix: HAVE_SCHED_SETAFFINITY is not defined Use '#ifdef' instead of '#if' to test if HAVE_SCHED_SETAFFINITY is defined. Both work but using '#if' on an undefined macro will generate a warning with '-Wundef'. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: Ieb46ddab9ba033a5c552dbe78ac398cea0a641e8
cleanup: all functions have declarations (-Wmissing-prototypes) Make sure that all non-static functions have a declaration. Change-Id: Ie1596ad4ba876183862e51508c8bd7fc0451fc5e Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Remove glibc < 2.4 compat code for sched_setaffinity Remove the rather large configure compat code for the version of sched_setaffinity as present in glibc < 2.4. Glibc 2.4 was released in 2006, we can safely assume nobody is still building new systems based on an even older version. Keep the normal sched_setaffinity detection and wrappers. This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: I62b1488849f88f56424f4d4ce570519d37c746c5 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix: bump tests thread limit to 4096 Machines with more than 128 CPUs are becomming more common. A future-proof fix here would be to dynamically allocate the array, but in the meantime bump the limit to 4096 to fix the problem on a 160 CPUs ppc64el system where this was reported. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Cc: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: Ib3cb5d8cb4515e6f626be33c2685fa38cb081782
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>
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>