From: Olivier Dion Date: Tue, 22 Aug 2023 20:23:17 +0000 (-0400) Subject: uatomic/x86: Remove redundant memory barriers X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=HEAD;hp=a3415009881c13c7401ab4b8d7c0216bbee63ce2 uatomic/x86: Remove redundant memory barriers When liburcu is configured to _not_ use atomic builtins, the implementation of atomic operations is done using inline assembler for each architecture. Because we control the emitted assembler, we know whether specific operations (e.g. lock; cmpxchg) already have an implicit memory barrier. In those cases, emitting an explicit cmm_smp_mb() before/after the operation is redundant and hurts performance. Remove those redundant barriers on x86. Change-Id: Ic1f6cfe9c2afe250946549cf6187f8fa88f5b009 Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- diff --git a/.gitignore b/.gitignore index af49d08..8b3a2ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2009-2022 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + tests/api.h @@ -18,8 +22,17 @@ tests/unit/test_urcu_multiflavor_single_unit tests/unit/test_urcu_multiflavor_single_unit_cxx tests/unit/test_urcu_multiflavor_single_unit_dynlink tests/unit/test_urcu_multiflavor_single_unit_dynlink_cxx +tests/unit/get_cpu_mask_from_sysfs +tests/unit/get_cpu_mask_from_sysfs_cxx +tests/unit/get_max_cpuid_from_sysfs +tests/unit/get_max_cpuid_from_sysfs_cxx +tests/unit/test_get_max_cpuid_from_mask +tests/unit/test_get_max_cpuid_from_mask_cxx +tests/unit/test_get_possible_cpus_array_len +tests/unit/test_get_possible_cpus_array_len_cxx tests/utils/libtap.a +tests/utils/env.sh tests/regression/rcutorture_urcu_bp tests/regression/rcutorture_urcu_bp_cxx @@ -33,7 +46,6 @@ tests/regression/rcutorture_urcu_signal tests/regression/rcutorture_urcu_signal_cxx tests/regression/test_urcu_fork_cxx.tap tests/regression/test_urcu_fork.tap -tests/regression/rcutorture*.tap tests/benchmark/test_rwlock_timing tests/benchmark/test_urcu diff --git a/.gitreview b/.gitreview index 84299ac..c197662 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + [gerrit] host=review.lttng.org port=29418 diff --git a/ChangeLog b/ChangeLog index fe236ac..a7fd349 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,90 @@ -2020-06-03 Userspace RCU 0.13.0 +# SPDX-FileCopyrightText: 2011-2023 Mathieu Desnoyers +# +# SPDX-License-Identifier: CC-BY-4.0 + +2023-02-14 Userspace RCU 0.14.0 + * Fix: urcu-bp: only teardown call-rcu worker in destructor + * Fix: rculfhash: urcu_die() takes positive error value + * Fix: call_rcu: teardown default call_rcu worker on application exit + * Fix: join worker thread in call_rcu_data_free + * Docs: clarify grace period polling API + * Document grace period polling in rcu-api.md + * Implement poll rcu stress test in rcutorture + * urcu-memb,mb,signal: Implement grace period polling + * Fix: auto-resize hash table destroy deadlock + * Fix building on MSYS2 + * rculfhash: Include rculfhash-internal.h from local directory + * Remove "Darwin" from "should also work on list" + * Merge branch 'adah1972-improve-md' + * Add semicolons at the end of function prototypes + * Wrap a file name in backticks + * Wrap command-line options in backticks + * Fix a wrong format + * Wrap URLs in angle brackets + * Fix Markdown issues + * Fix: Always check pthread_create for failures + * Disable signals in URCU background threads + * Fix: futex.h: include headers outside extern C + * Fix: add missing unused attribute to _rcu_dereference + * Fix: change method used by _rcu_dereference to strip type constness + * Fix: remove type constness in URCU_FORCE_CAST's C++ version + * Move extern "C" down in include/urcu/urcu-bp.h + * fix: ifdef linux specific cpu count compat + * Add unit tests for possible_cpus_array_len + * fix: sysconf(_SC_NPROCESSORS_CONF) can be less than max cpu id + * Fix: revise obsolete command in README.md + * Fix: workqueue: remove unused variable "ret" + * Fix: urcu-qsbr: futex wait: handle spurious futex wakeups + * Fix: urcu: futex wait: handle spurious futex wakeups + * Fix: urcu-wait: futex wait: handle spurious futex wakeups + * Fix: defer_rcu: futex wait: handle spurious futex wakeups + * Fix: call_rcu: futex wait: handle spurious futex wakeups + * Fix: workqueue: futex wait: handle spurious futex wakeups + * Fix: Use %lu rather than %ld to print count + * Update ABI definition files + * Bump version current and age + * alpha: allocate membarrier system call number + * Bump version to 0.14.0-pre + * Improved test framework + * rculfhash: introduce cds_lfht_node_init_deleted + * Fix: changelog: v0.13.0 was released in 2021 + * cleanup: i386 arch detection + * fix: properly detect 'cmpxchg' on x86-32 + * fix: use urcu-tls compat with c++ compiler + * Fix typo + * fix: remove autoconf features default value in help message + * fix: add missing pkgconfig file for memb flavour lib + * Cleanup: Tests: Remove useless pre-C99 compatibility code from tap.h + * Document C99 and C++11 requirement in README.md + * Always use '__thread' for Thread local storage except on MSVC + * Fix: powerpc32: transparent unions alter calling convention + * fix: don't use C++ thread_local on MacOs + * wfcqueue API: implement overloaded wrappers with templates + * wfcqueue: combine C++ API cds_wfcq_head_cast with overloading + * wfstack C++ API: implement overloaded wrappers with templates + * lfstack C++ API: implement overloaded wrappers with templates + * wfstack: combine C++ API cds_wfs_stack_cast with overloading + * lfstack: combine C++ API cds_lfs_stack_cast with overloading + * fix: test_build tap plan + * Test C++ build of list head init + * Fix order of initializers in CDS_LIST_HEAD_INIT + * unit tests: test wfcqueue, wfstack, lfstack empty check functions in C++ + * wfcqueue: implement C++ API based on function overloading + * wfstack: implement C++ API based on function overloading + * lfstack: implement C++ API based on function overloading + * Fix tap.h: remove extra semicolon in pass/fail macros + * Add C++ build tests + * Build and run regression and unit tests as C++ programs + * Add --enable-Werror configure switch + * Add `urcu_posix_assert()` as `assert()` replacement + * Rename `urcu_assert()` to `urcu_assert_debug()` + * cleanup: spelling fixes in comments + * Make temporary variable in _rcu_dereference non-const + * (tls-ie2) Fix: x86 and s390: uatomic __hp() macro C++ support + * Fix: x86 and s390: uatomic __hp() macro clang support + * Fix: x86 and s390 uatomic: __hp() macro warning with gcc 11 + +2021-06-03 Userspace RCU 0.13.0 * Document known ABI issue in README.md * Add serialized ABI definition files * bump SONAME major to 8 diff --git a/CodingStyle b/CodingStyle deleted file mode 100644 index 5a33e8d..0000000 --- a/CodingStyle +++ /dev/null @@ -1,10 +0,0 @@ -Userspace RCU Coding Style - -The coding style used for this project follows the Linux kernel -guide lines. Please refer to: - -- Linux kernel Documentation/CodingStyle document for details, -- Linux kernel scripts/checkpatch.pl for a script which verify the patch - coding style. - -Mathieu Desnoyers, May 30, 2012 diff --git a/CodingStyle.md b/CodingStyle.md new file mode 100644 index 0000000..d2ad79a --- /dev/null +++ b/CodingStyle.md @@ -0,0 +1,16 @@ + + +# Userspace RCU Coding Style + +The coding style used for this project follows the Linux kernel +guide lines. Please refer to: + +- Linux kernel Documentation/CodingStyle document for details, +- Linux kernel scripts/checkpatch.pl for a script which verify the patch + coding style. + +Mathieu Desnoyers, May 30, 2012 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a06fdcc..0000000 --- a/LICENSE +++ /dev/null @@ -1,63 +0,0 @@ -Userspace RCU library licensing -Mathieu Desnoyers -September 3, 2012 - - -* LGPLv2.1 - -The library part is distributed under LGPLv2.1 or later. See lgpl-2.1.txt for -license details. Refer to the individual file headers for details. - -LGPL-compatible source code can statically use the library header using : - -#define _LGPL_SOURCE -#include - -Dynamic-only linking with the LGPL library is used if _LGPL_SOURCE is not -defined. It permits relinking with newer versions of the library, which is -required by the LGPL license. - -See lgpl-relicensing.txt for details. - - -* MIT-style license : - -xchg() primitive has been rewritten from scratch starting from atomic_ops 1.2 -which has a MIT-style license that is intended to allow use in both free and -proprietary software: - http://www.hpl.hp.com/research/linux/atomic_ops/LICENSING.txt - http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ - -This MIT-style license (BSD like) apply to: - -uatomic/gcc.h -uatomic/unknown.h -uatomic/generic.h -uatomic/sparc64.h -uatomic/arm.h -uatomic/ppc.h -uatomic/x86.h -uatomic.h - -MIT/X11 (BSD like) license apply to: - -compiler.h -arch/s390.h -uatomic/alpha.h -uatomic/mips.h -uatomic/nios2.h -uatomic/s390.h -system.h - - -* GPLv2 - -Library test code is distributed under the GPLv2 license. See gpl-2.0.txt for -license details. See headers of individual files under tests/ for details. - - -* GPLv3 (or later) - -The following build-related macro is under GPLv3 (or later): - -m4/ax_tls.m4 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..6a5d204 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,64 @@ +# Userspace RCU library licensing + +This project is compliant with the [REUSE](https://reuse.software/spec/) +specification, each file contains [SPDX](https://spdx.org/specifications) tags, +the full licenses can be found in the `LICENSES/` directory. + + +## Library code + +The library part is distributed under `LGPL-2.1-or-later`. See +`LICENSES/LGPL-2.1-or-later.txt` for license details. Refer to the individual +file headers for details. + +LGPL-compatible source code can statically use the library header using : + +```` +#define _LGPL_SOURCE +#include +```` + +Dynamic-only linking with the LGPL library is used if `_LGPL_SOURCE` is not +defined. It permits relinking with newer versions of the library, which is +required by the LGPL license. + +See `lgpl-relicensing.md` for details. + + +## Headers + +Most headers are also distributed under `LGPL-2.1-or-later`, some include code +from `atomic_ops` and are distributed under `Boehm-GC` and some others are +distributed under `MIT`. Refer to the individual file headers for details. + +xchg() primitive has been rewritten from scratch starting from `atomic_ops 1.2` +which has a MIT-style license that is intended to allow use in both free and +proprietary software: + +```` +http://www.hpl.hp.com/research/linux/atomic_ops/LICENSING.txt +http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/ +```` + + +## Tests + +Library test code is distributed under the `GPL-2.0-only` license. See +`LICENSES/GPL-2.0-only.txt` for license details. See headers of individual +files under `tests/` for details. + + +## Documentation + +The documentation is distributed under the `CC-BY-4.0` license. + + +## Build system + +Build system related files are mostly distributed under the `MIT` license. See +headers of individual files for details. + + +## Generated data files + +Generated data files are distributed under the `CC-1.0` license. diff --git a/LICENSES/Autoconf-exception-2.0.txt b/LICENSES/Autoconf-exception-2.0.txt new file mode 100644 index 0000000..00cddeb --- /dev/null +++ b/LICENSES/Autoconf-exception-2.0.txt @@ -0,0 +1,5 @@ +As a special exception, the Free Software Foundation gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of Autoconf appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf program. + +Certain portions of the Autoconf source text are designed to be copied (in certain cases, depending on the input) into the output of Autoconf. We call these the "data" portions. The rest of the Autoconf source text consists of comments plus executable code that decides which of the data portions to output in any given case. We call these comments and executable code the "non-data" portions. Autoconf never copies any of the non-data portions into its output. + +This special exception to the GPL applies to versions of Autoconf released by the Free Software Foundation. When you make and distribute a modified version of Autoconf, you may extend this special exception to the GPL to apply to your modified version as well, *unless* your modified version has the potential to copy into its output some of the text that was the non-data portion of the version that you started with. (In other words, unless your change moves or copies text from the non-data portions to the data portions.) If your modification has such potential, you must delete any notice of this special exception to the GPL from your modified version. diff --git a/LICENSES/BSD-2-Clause.txt b/LICENSES/BSD-2-Clause.txt new file mode 100644 index 0000000..5f662b3 --- /dev/null +++ b/LICENSES/BSD-2-Clause.txt @@ -0,0 +1,9 @@ +Copyright (c) + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt new file mode 100644 index 0000000..13ca539 --- /dev/null +++ b/LICENSES/CC-BY-4.0.txt @@ -0,0 +1,156 @@ +Creative Commons Attribution 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + +b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/LICENSES/FSFAP.txt b/LICENSES/FSFAP.txt new file mode 100644 index 0000000..32bc8a8 --- /dev/null +++ b/LICENSES/FSFAP.txt @@ -0,0 +1 @@ +Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. diff --git a/LICENSES/GPL-2.0-only.txt b/LICENSES/GPL-2.0-only.txt new file mode 100644 index 0000000..17cb286 --- /dev/null +++ b/LICENSES/GPL-2.0-only.txt @@ -0,0 +1,117 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice diff --git a/LICENSES/GPL-2.0-or-later.txt b/LICENSES/GPL-2.0-or-later.txt new file mode 100644 index 0000000..17cb286 --- /dev/null +++ b/LICENSES/GPL-2.0-or-later.txt @@ -0,0 +1,117 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt new file mode 100644 index 0000000..f6cdd22 --- /dev/null +++ b/LICENSES/GPL-3.0-or-later.txt @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/LICENSES/LGPL-2.1-only.txt b/LICENSES/LGPL-2.1-only.txt new file mode 100644 index 0000000..c9aa530 --- /dev/null +++ b/LICENSES/LGPL-2.1-only.txt @@ -0,0 +1,175 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the library `Frob' (a library for tweaking knobs) written +by James Random Hacker. + +signature of Ty Coon, 1 April 1990 +Ty Coon, President of Vice +That's all there is to it! diff --git a/LICENSES/LGPL-2.1-or-later.txt b/LICENSES/LGPL-2.1-or-later.txt new file mode 100644 index 0000000..c9aa530 --- /dev/null +++ b/LICENSES/LGPL-2.1-or-later.txt @@ -0,0 +1,175 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the library `Frob' (a library for tweaking knobs) written +by James Random Hacker. + +signature of Ty Coon, 1 April 1990 +Ty Coon, President of Vice +That's all there is to it! diff --git a/LICENSES/LicenseRef-Autoconf-exception-macro.txt b/LICENSES/LicenseRef-Autoconf-exception-macro.txt new file mode 100644 index 0000000..8b5b467 --- /dev/null +++ b/LICENSES/LicenseRef-Autoconf-exception-macro.txt @@ -0,0 +1,12 @@ +As a special exception, the respective Autoconf Macro's copyright owner +gives unlimited permission to copy, distribute and modify the configure +scripts that are the output of Autoconf when processing the Macro. You +need not follow the terms of the GNU General Public License when using +or distributing such scripts, even though portions of the text of the +Macro appear in them. The GNU General Public License (GPL) does govern +all other use of the material that constitutes the Autoconf Macro. + +This special exception to the GPL applies to versions of the Autoconf +Macro released by the Autoconf Archive. When you make and distribute a +modified version of the Autoconf Macro, you may extend this special +exception to the GPL to apply to your modified version as well. diff --git a/LICENSES/LicenseRef-Boehm-GC.txt b/LICENSES/LicenseRef-Boehm-GC.txt new file mode 100644 index 0000000..95427c0 --- /dev/null +++ b/LICENSES/LicenseRef-Boehm-GC.txt @@ -0,0 +1,12 @@ +Copyright (c) ... + +THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED +OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + +Permission is hereby granted to use or copy this program +for any purpose, provided the above notices are retained on all copies. +Permission to modify the code and to distribute modified code is granted, +provided the above notices are retained, and a notice that the code was +modified is included with the above copyright notice. + +A few files have other copyright holders. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..2071b23 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile.am b/Makefile.am index 613e1cd..539a2ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,15 +1,30 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + ACLOCAL_AMFLAGS=-I m4 SUBDIRS = include src doc tests extras -dist_doc_DATA = LICENSE \ - README.md - -dist_noinst_DATA = CodingStyle +dist_doc_DATA = \ + LICENSE.md \ + README.md -EXTRA_DIST = gpl-2.0.txt \ - lgpl-2.1.txt \ - lgpl-relicensing.txt +EXTRA_DIST = \ + CodingStyle.md \ + lgpl-relicensing.md \ + LICENSES/Autoconf-exception-2.0.txt \ + LICENSES/BSD-2-Clause.txt \ + LICENSES/CC0-1.0.txt \ + LICENSES/CC-BY-4.0.txt \ + LICENSES/FSFAP.txt \ + LICENSES/GPL-2.0-only.txt \ + LICENSES/GPL-2.0-or-later.txt \ + LICENSES/LGPL-2.1-only.txt \ + LICENSES/LGPL-2.1-or-later.txt \ + LICENSES/LicenseRef-Autoconf-exception-macro.txt \ + LICENSES/LicenseRef-Boehm-GC.txt \ + LICENSES/MIT.txt .PHONY: short_bench long_bench regtest check-loop short_bench: diff --git a/README.md b/README.md index a8318c8..d868ac4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + Userspace RCU Implementation ============================ @@ -38,7 +44,7 @@ Architectures supported Currently, the following architectures are supported: - x86 (i386, i486, i586, i686) - - amd64 / x86_64 + - amd64 / x86\_64 - PowerPC 32/64 - S390, S390x - ARM 32/64 @@ -51,12 +57,12 @@ Currently, the following architectures are supported: - hppa/PA-RISC - m68k - RISC-V + - LoongArch Tested on: - Linux all architectures - - FreeBSD 8.2/8.3/9.0/9.1/10.0 i386/amd64 - - Solaris 10/11 i386 + - FreeBSD 13 i386/amd64 - Cygwin i386/amd64 - MacOS amd64/arm64 @@ -65,30 +71,31 @@ Should also work on: - Android - NetBSD 5 - OpenBSD - - Darwin + - Solaris (more testing needed before claiming support for these OS). -Linux ARM depends on running a Linux kernel 2.6.15 or better, GCC 4.4 or -better. -The C compiler used needs to support at least C99. The C++ compiler used -needs to support at least C++11. +Toolchain support +----------------- + +The C compiler used needs to support at least C99. The C++ compiler used needs +to support at least C++11. The oldest GCC version officialy supported and +tested is 4.8. -The GCC compiler versions 3.3, 3.4, 4.0, 4.1, 4.2, 4.3, 4.4 and 4.5 are -supported, with the following exceptions: +Older GCC versions might still work with the following exceptions: - GCC 3.3 and 3.4 have a bug that prevents them from generating volatile accesses to offsets in a TLS structure on 32-bit x86. These versions are therefore not compatible with `liburcu` on x86 32-bit (i386, i486, i586, i686). The problem has been reported to the GCC community: - http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg281255.html + - GCC 3.3 cannot match the "xchg" instruction on 32-bit x86 build. - See http://kerneltrap.org/node/7507 + See - Alpha, ia64 and ARM architectures depend on GCC 4.x with atomic builtins support. For ARM this was introduced with GCC 4.4: - http://gcc.gnu.org/gcc-4.4/changes.html. + . - Linux aarch64 depends on GCC 5.1 or better because prior versions perform unsafe access to deallocated stack. @@ -97,6 +104,10 @@ Clang version 3.0 (based on LLVM 3.0) is supported. Glibc >= 2.4 should work but the older version we test against is currently 2.17. + +Build system +------------ + For developers using the Git tree: This source tree is based on the autotools suite from GNU to simplify @@ -106,7 +117,7 @@ compile the git repository tree : - GNU autotools (automake >=1.12, autoconf >=2.69) (make sure your system wide `automake` points to a recent version!) - GNU Libtool >=2.2 - (for more information, go to http://www.gnu.org/software/autoconf/) + (for more information, go to ) If you get the tree from the repository, you will need to use the `bootstrap` script in the root of the tree. It calls all the GNU tools needed to prepare @@ -160,11 +171,10 @@ There are multiple flavors of liburcu available: - `memb`, - `qsbr`, - `mb`, - - `signal`, - `bp`. -The API members start with the prefix "urcu__", where - is the chosen flavor name. +The API members start with the prefix `urcu__`, where +`` is the chosen flavor name. ### Usage of `liburcu-memb` @@ -176,7 +186,7 @@ This is the preferred version of the library, in terms of grace-period detection speed, read-side speed and flexibility. Dynamically detects kernel support for `sys_membarrier()`. Falls back on `urcu-mb` scheme if support is not present, which has slower -read-side. Use the --disable-sys-membarrier-fallback configure option +read-side. Use the `--disable-sys-membarrier-fallback` configure option to disable the fall back, thus requiring `sys_membarrier()` to be available. This gives a small speedup when `sys_membarrier()` is supported by the kernel, and aborts in the library constructor if not @@ -205,15 +215,6 @@ and reader sides. This results in faster grace-period detection, but results in slower reads. -### Usage of `liburcu-signal` - - 1. `#include ` - 2. Link the application with `-lurcu-signal` - -Version of the library that requires a signal, typically `SIGUSR1`. Can -be overridden with `-DSIGRCU` by modifying `Makefile.build.inc`. - - ### Usage of `liburcu-bp` 1. `#include ` @@ -251,11 +252,19 @@ protected pointer. After, `urcu__synchronize_rcu()` must be called. When it returns, the old values are not in usage anymore. +As an alternative to `urcu__synchronize_rcu()`, +it is also possible to use the urcu polling mechanism to wait for a +grace period to elapse. This can be done by using +`urcu__start_poll_synchronize_rcu()` +to start the grace period polling, and then invoke +`urcu__poll_state_synchronize_rcu()`, which returns true if +the grace period has completed, false otherwise. + ### Usage of `liburcu-defer` - Follow instructions for either `liburcu-memb`, `liburcu-qsbr`, - `liburcu-mb`, `liburcu-signal`, or `liburcu-bp` above. + `liburcu-mb`, or `liburcu-bp` above. The `liburcu-defer` functionality is pulled into each of those library modules. - Provides `urcu__defer_rcu()` primitive to enqueue delayed @@ -274,7 +283,7 @@ Its API is currently experimental. It may change in future library releases. ### Usage of `urcu-call-rcu` - Follow instructions for either `liburcu-memb`, `liburcu-qsbr`, - `liburcu-mb`, `liburcu-signal`, or `liburcu-bp` above. + `liburcu-mb`, or `liburcu-bp` above. The `urcu-call-rcu` functionality is pulled into each of those library modules. - Provides the `urcu__call_rcu()` primitive to enqueue delayed @@ -292,13 +301,6 @@ Its API is currently experimental. It may change in future library releases. ### Being careful with signals -The `liburcu-signal` library uses signals internally. The signal handler is -registered with the `SA_RESTART` flag. However, these signals may cause -some non-restartable system calls to fail with `errno = EINTR`. Care -should be taken to restart system calls manually if they fail with this -error. A list of non-restartable system calls may be found in -`signal(7)`. - Read-side critical sections are allowed in a signal handler, except those setup with `sigaltstack(2)`, with `liburcu-memb` and `liburcu-mb`. Be careful, however, to disable these signals @@ -382,11 +384,12 @@ By default the library is configured with internal debugging self-checks disabled. For always-on debugging self-checks: - ./configure --enable-rcu-debug + + ./configure --enable-rcu-debug For fine grained enabling of debugging self-checks, build -userspace-rcu with DEBUG_RCU defined and compile dependent -applications with DEBUG_RCU defined when necessary. +userspace-rcu with `DEBUG_RCU` defined and compile dependent +applications with `DEBUG_RCU` defined when necessary. Warning: Enabling this feature result in a performance penalty. @@ -413,7 +416,7 @@ theoretically yielding slightly better performance. By default the library is configured with extra debugging checks for lock-free hash table iterator traversal disabled. -Building liburcu with --enable-cds-lfht-iter-debug and rebuilding +Building liburcu with `--enable-cds-lfht-iter-debug` and rebuilding application to match the ABI change allows finding cases where the hash table iterator is re-purposed to be used on a different hash table while still being used to iterate on a hash table. @@ -421,19 +424,24 @@ still being used to iterate on a hash table. This option alters the rculfhash ABI. Make sure to compile both library and application with matching configuration. +### Usage of `--enable-compiler-atomic-builtins` + +Building liburcu with `--enable-compiler-atomic-builtins` implements the uatomic +API with the compiler atomic builtins if supported. Make targets ------------ In addition to the usual `make check` target, Userspace RCU features -`make regtest` and `make bench` targets: +`make regtest`, `make short_bench` and `make long_bench` targets: - `make check`: short tests, meant to be run when rebuilding or porting Userspace RCU. - `make regtest`: long (many hours) test, meant to be run when modifying Userspace RCU or porting it to a new architecture or operating system. - - `make bench`: long (many hours) benchmarks. + - `make short_bench`: short benchmarks, 3 seconds per test. + - `make long_bench`: long (many hours) benchmarks, 30 seconds per test. Known issues @@ -444,9 +452,9 @@ applications built using Userspace RCU 0.10 headers linked against Userspace RCU 0.11 or 0.12 shared objects. The problem occurs as follows: - - An application executable is built with _LGPL_SOURCE defined, includes + - An application executable is built with `_LGPL_SOURCE` defined, includes any of the Userspace RCU 0.10 urcu flavor headers, and is built - without the -fpic compiler option. + without the `-fpic` compiler option. - The Userspace RCU 0.10 library shared objects are updated to 0.11 or 0.12 without rebuilding the application. @@ -458,7 +466,7 @@ Some possible work-arounds for this are: - Rebuild the application against Userspace RCU 0.11+. - - Rebuild the application with -fpic. + - Rebuild the application with `-fpic`. - Upgrade Userspace RCU to 0.13+ without installing 0.11 nor 0.12. @@ -468,3 +476,18 @@ Contacts You can contact the maintainers on the following mailing list: `lttng-dev@lists.lttng.org`. + +IRC channel: [#lttng](irc://irc.oftc.net/lttng) on the OFTC network + +Bug tracker: [Userspace RCU bug tracker](https://bugs.lttng.org/projects/urcu) + +Code review: [_userspace-rcu_ project](https://review.lttng.org/q/project:userspace-rcu) on LTTng Review + +Continuous integration: [Userspace RCU](https://ci.lttng.org/view/Liburcu/) on LTTng's CI + +GitHub mirror: [urcu/userspace-rcu](https://github.com/urcu/userspace-rcu) + +Patches are principally submitted and reviewed on [LTTng Review](https://review.lttng.org), +but may also be submitted to the [mailing list](mailto:lttng-dev@lists.lttng.org) +with the subject prefix `PATCH urcu` or by pull request on the +[GitHub mirror](https://github.com/urcu/userspace-rcu). diff --git a/bootstrap b/bootstrap index f278ad9..47a85ff 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,8 @@ #!/bin/sh + +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. # -# SPDX-License-Identifier: LGPL-2.1-only +# SPDX-License-Identifier: MIT set -x if [ ! -d "config" ]; then diff --git a/configure.ac b/configure.ac index a044f64..2807932 100644 --- a/configure.ac +++ b/configure.ac @@ -6,17 +6,17 @@ dnl Process this file with autoconf to produce a configure script. # Project version information m4_define([urcu_version_major], [0]) -m4_define([urcu_version_minor], [13]) +m4_define([urcu_version_minor], [15]) m4_define([urcu_version_patch], [0]) -m4_define([urcu_version_dev_stage], []) +m4_define([urcu_version_dev_stage], [-pre]) m4_define([urcu_version], urcu_version_major[.]urcu_version_minor[.]urcu_version_patch[]urcu_version_dev_stage) # Library version information of "liburcu" # Following the numbering scheme proposed by libtool for the library version # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -m4_define([urcu_lib_version_current], [8]) +m4_define([urcu_lib_version_current], [9]) m4_define([urcu_lib_version_revision], [0]) -m4_define([urcu_lib_version_age], [0]) +m4_define([urcu_lib_version_age], [1]) m4_define([urcu_lib_version], urcu_lib_version_current[:]urcu_lib_version_revision[:]urcu_lib_version_age) @@ -51,7 +51,7 @@ AM_SILENT_RULES([yes]) ## ## AS_CASE([$host], - [*-cygwin*], [LT_NO_UNDEFINED="-no-undefined"] + [*-cygwin* | *-msys*], [LT_NO_UNDEFINED="-no-undefined"] ) @@ -71,6 +71,10 @@ AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not s AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE +# Check if the selected C compiler supports atomic builtins +AE_CC_ATOMIC_BUILTINS + + ## ## ## C++ compiler checks ## ## ## @@ -161,14 +165,7 @@ AC_PROG_GREP AC_PROG_MAKE_SET AC_CHECK_PROGS(NPROC, [nproc gnproc]) AC_CHECK_PROGS(GETCONF, [getconf]) -AS_IF([test "x$NPROC" != "x"], - [NPROC_CMD=$NPROC], - [AS_IF([test "x$GETCONF" != "x"], - [NPROC_CMD="$GETCONF _NPROCESSORS_ONLN"], - [NPROC_CMD="echo 1"] - )] -) -AC_SUBST([NPROC_CMD], [$NPROC_CMD]) +AC_CHECK_PROGS(TIME, [time]) # Initialize and configure libtool LT_INIT @@ -237,6 +234,16 @@ AE_FEATURE([rcu-debug], [Enable internal debugging self-checks. Introduces a per AE_FEATURE_DEFAULT_DISABLE AE_FEATURE([cds-lfht-iter-debug], [Enable extra debugging checks for lock-free hash table iterator traversal. Alters the rculfhash ABI. Make sure to compile both library and application with matching configuration.]) +# Use compiler atomic builtins, when disabled use our legacy uatomic implementation. +# Disabled by default +AE_FEATURE_DEFAULT_DISABLE +AE_FEATURE([compiler-atomic-builtins], [Enable the use of compiler atomic builtins.]) + +# emit legacy memory barriers +# Enable by default +AE_FEATURE_DEFAULT_ENABLE +AE_FEATURE([legacy-mb], [Disable legacy memory barriers.]) + # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS. # Disabled by default AE_FEATURE_DEFAULT_DISABLE @@ -266,6 +273,13 @@ AE_IF_FEATURE_ENABLED([cds-lfht-iter-debug], [ AC_DEFINE([CONFIG_CDS_LFHT_ITER_DEBUG], [1], [Enable extra debugging checks for lock-free hash table iterator traversal. Alters the rculfhash ABI. Make sure to compile both library and application with matching configuration.]) ]) +AE_IF_FEATURE_ENABLED([compiler-atomic-builtins], [ + AC_DEFINE([CONFIG_RCU_USE_ATOMIC_BUILTINS], [1], [Use compiler atomic builtins.]) +]) + +AE_IF_FEATURE_ENABLED([legacy-mb], [ + AC_DEFINE([CONFIG_RCU_EMIT_LEGACY_MB], [1], [Emit legacy memory barriers that were documented in the APIs.]) +]) ## ## ## Set automake variables for optional feature conditionnals in Makefile.am ## @@ -275,6 +289,17 @@ AE_IF_FEATURE_ENABLED([cds-lfht-iter-debug], [ AM_CONDITIONAL([ENABLE_EXAMPLES], AE_IS_FEATURE_ENABLED([shared])) +## ## +## Check for optional features dependencies ## +## ## + + +AE_IF_FEATURE_ENABLED([compiler-atomic-builtins], [ + AS_IF([test "x$ae_cv_cc_atomic_builtins" != xyes], [ + AC_MSG_ERROR([The compiler does not support atomic builtins.]) + ]) +]) + ## ## ## Substitute variables for use in Makefile.am ## ## ## @@ -320,129 +345,9 @@ AC_CONFIG_FILES([ src/liburcu-qsbr.pc src/liburcu-mb.pc src/liburcu-memb.pc - src/liburcu-signal.pc ]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_global.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_perf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_perf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_rperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_rperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_global.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_stress_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_stress_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_bp_uperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_bp_uperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_global.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_perf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_perf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_rperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_rperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_global.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_stress_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_stress_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_mb_uperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_mb_uperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_global.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_perf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_perf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_rperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_rperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_global.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_stress_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_stress_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_membarrier_uperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_membarrier_uperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_global.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_perf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_perf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_rperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_rperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_global.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_stress_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_stress_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_qsbr_uperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_qsbr_uperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_global.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_perf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_perf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_rperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_rperf_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_global.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_stress_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_stress_perthread_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_global.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_global.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_global_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_global_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_percpu.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_percpu.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_percpu_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_percpu_cxx.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_perthread.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_perthread.tap]) -AC_CONFIG_FILES([tests/regression/rcutorture_urcu_signal_uperf_perthread_cxx.tap], [chmod +x tests/regression/rcutorture_urcu_signal_uperf_perthread_cxx.tap]) +AC_CONFIG_FILES([tests/utils/env.sh],[chmod +x tests/utils/env.sh]) AC_OUTPUT @@ -451,50 +356,58 @@ AC_OUTPUT # Mini-report on what will be built. # -PPRINT_INIT -PPRINT_SET_INDENT(1) -PPRINT_SET_TS(38) +AE_PPRINT_INIT +AE_PPRINT_SET_INDENT(1) +AE_PPRINT_SET_TS(38) AS_ECHO -AS_ECHO("${PPRINT_COLOR_BLDBLU}Userspace-RCU $PACKAGE_VERSION${PPRINT_COLOR_RST}") +AS_ECHO("${AE_PPRINT_COLOR_BLDBLU}Userspace-RCU $PACKAGE_VERSION${AE_PPRINT_COLOR_RST}") AS_ECHO -PPRINT_SUBTITLE([Features]) +AE_PPRINT_SUBTITLE([Features]) -PPRINT_PROP_STRING([Target architecture], $host_cpu) +AE_PPRINT_PROP_STRING([Target architecture], $host_cpu) # SMP support enabled/disabled AE_IS_FEATURE_ENABLED([smp-support]) && value=1 || value=0 -PPRINT_PROP_BOOL([SMP support], $value) +AE_PPRINT_PROP_BOOL([SMP support], $value) # TLS AE_IS_FEATURE_ENABLED([compiler-tls]) && value="compiler TLS" || value="pthread_getspecific()" -PPRINT_PROP_STRING([Thread Local Storage (TLS)], [$value]) +AE_PPRINT_PROP_STRING([Thread Local Storage (TLS)], [$value]) # clock_gettime() available test "x$ac_cv_search_function_clock_gettime" != "xno" && value=1 || value=0 -PPRINT_PROP_BOOL([clock_gettime()], $value) +AE_PPRINT_PROP_BOOL([clock_gettime()], $value) # Require membarrier AE_IS_FEATURE_ENABLED([sys-membarrier-fallback]) && value=0 || value=1 -PPRINT_PROP_BOOL([Require membarrier], $value) +AE_PPRINT_PROP_BOOL([Require membarrier], $value) # RCU debug enabled/disabled AE_IS_FEATURE_ENABLED([rcu-debug]) && value=1 || value=0 -PPRINT_PROP_BOOL([Internal debugging], $value) +AE_PPRINT_PROP_BOOL([Internal debugging], $value) # rculfhash iterator debug enabled/disabled AE_IS_FEATURE_ENABLED([cds-lfht-iter-debug]) && value=1 || value=0 -PPRINT_PROP_BOOL([Lock-free HT iterator debugging], $value) +AE_PPRINT_PROP_BOOL([Lock-free HT iterator debugging], $value) + +AE_PPRINT_PROP_BOOL([Multi-flavor support], 1) + +# atomic builtins enabled/disabled +AE_IS_FEATURE_ENABLED([compiler-atomic-builtins]) && value=1 || value=0 +AE_PPRINT_PROP_BOOL([Use compiler atomic builtins], $value) -PPRINT_PROP_BOOL([Multi-flavor support], 1) +# legacy memory barriers +AE_IS_FEATURE_ENABLED([legacy-mb]) && value=1 || value=0 +AE_PPRINT_PROP_BOOL([Emit legacy memory barriers], $value) report_bindir="`eval eval echo $bindir`" report_libdir="`eval eval echo $libdir`" # Print the bindir and libdir this 'make install' will install into. AS_ECHO -PPRINT_SUBTITLE([Install directories]) -PPRINT_PROP_STRING([Binaries], [$report_bindir]) -PPRINT_PROP_STRING([Libraries], [$report_libdir]) +AE_PPRINT_SUBTITLE([Install directories]) +AE_PPRINT_PROP_STRING([Binaries], [$report_bindir]) +AE_PPRINT_PROP_STRING([Libraries], [$report_libdir]) diff --git a/doc/Makefile.am b/doc/Makefile.am index cf2e902..19a2709 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + SUBDIRS = examples dist_doc_DATA = rcu-api.md \ diff --git a/doc/cds-api.md b/doc/cds-api.md index 5bc615e..9940a36 100644 --- a/doc/cds-api.md +++ b/doc/cds-api.md @@ -1,3 +1,9 @@ + + Userspace RCU Concurrent Data Structures (CDS) API ================================================== @@ -33,12 +39,12 @@ Downside over `list.h`: lookup of tail in O(n). Doubly-linked list, with single pointer list head. Requires mutual exclusion on updates, allows RCU read traversals. Useful -for implementing hash tables. Downside over rculist.h: lookup of tail in O(n). +for implementing hash tables. Downside over `rculist.h`: lookup of tail in O(n). ### `urcu/wfstack.h` -Stack with wait-free push and wait-free pop_all. Both +Stack with wait-free push and wait-free pop\_all. Both blocking and non-blocking pop and traversal operations are provided. This stack does _not_ specifically rely on RCU. Various synchronization techniques can be used to deal with pop ABA. Those are detailed in the API. @@ -59,7 +65,7 @@ traversal (see API for details). ### `urcu/lfstack.h` -Stack with lock-free push, lock-free pop, wait-free pop_all, +Stack with lock-free push, lock-free pop, wait-free pop\_all, wait-free traversal. Various synchronization techniques can be used to deal with pop ABA. Those are detailed in the API. This stack does _not_ specifically rely on RCU. diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 2046381..8169169 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + doc_examplesdir = ${docdir}/examples doc_examples_urcu_flavorsdir = ${doc_examplesdir}/urcu-flavors @@ -7,12 +11,10 @@ dist_doc_examples_urcu_flavors_DATA = \ urcu-flavors/Makefile.qsbr \ urcu-flavors/Makefile.mb \ urcu-flavors/Makefile.membarrier \ - urcu-flavors/Makefile.signal \ urcu-flavors/Makefile.bp \ urcu-flavors/qsbr.c \ urcu-flavors/mb.c \ urcu-flavors/membarrier.c \ - urcu-flavors/signal.c \ urcu-flavors/bp.c dist_doc_examples_DATA = \ diff --git a/doc/examples/Makefile.examples.template b/doc/examples/Makefile.examples.template index e6196f5..21cac7b 100644 --- a/doc/examples/Makefile.examples.template +++ b/doc/examples/Makefile.examples.template @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. LOCAL_CFLAGS := -g -O2 -Wall diff --git a/doc/examples/dist-files/Makefile b/doc/examples/dist-files/Makefile index 08f3728..676d9b3 100644 --- a/doc/examples/dist-files/Makefile +++ b/doc/examples/dist-files/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/hlist/Makefile b/doc/examples/hlist/Makefile index 4256035..c06be16 100644 --- a/doc/examples/hlist/Makefile +++ b/doc/examples/hlist/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/hlist/Makefile.cds_hlist_add_head_rcu b/doc/examples/hlist/Makefile.cds_hlist_add_head_rcu index f1bf7d7..1f225fd 100644 --- a/doc/examples/hlist/Makefile.cds_hlist_add_head_rcu +++ b/doc/examples/hlist/Makefile.cds_hlist_add_head_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_hlist_add_head_rcu diff --git a/doc/examples/hlist/Makefile.cds_hlist_del_rcu b/doc/examples/hlist/Makefile.cds_hlist_del_rcu index 642b04d..e042ffa 100644 --- a/doc/examples/hlist/Makefile.cds_hlist_del_rcu +++ b/doc/examples/hlist/Makefile.cds_hlist_del_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_hlist_del_rcu diff --git a/doc/examples/hlist/Makefile.cds_hlist_for_each_entry_rcu b/doc/examples/hlist/Makefile.cds_hlist_for_each_entry_rcu index 035ecbf..86380a5 100644 --- a/doc/examples/hlist/Makefile.cds_hlist_for_each_entry_rcu +++ b/doc/examples/hlist/Makefile.cds_hlist_for_each_entry_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_hlist_for_each_entry_rcu diff --git a/doc/examples/hlist/Makefile.cds_hlist_for_each_rcu b/doc/examples/hlist/Makefile.cds_hlist_for_each_rcu index 23d0a0c..9b40d8a 100644 --- a/doc/examples/hlist/Makefile.cds_hlist_for_each_rcu +++ b/doc/examples/hlist/Makefile.cds_hlist_for_each_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_hlist_for_each_rcu diff --git a/doc/examples/hlist/cds_hlist_add_head_rcu.c b/doc/examples/hlist/cds_hlist_add_head_rcu.c index 3aece5e..6087bae 100644 --- a/doc/examples/hlist/cds_hlist_add_head_rcu.c +++ b/doc/examples/hlist/cds_hlist_add_head_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add into a non-circular linked-list safely * against concurrent RCU traversals. */ diff --git a/doc/examples/hlist/cds_hlist_del_rcu.c b/doc/examples/hlist/cds_hlist_del_rcu.c index 28b6c42..1ef229f 100644 --- a/doc/examples/hlist/cds_hlist_del_rcu.c +++ b/doc/examples/hlist/cds_hlist_del_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to remove from a non-circular linked-list * safely against concurrent RCU traversals. */ diff --git a/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c b/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c index 1be4ac5..bf675fd 100644 --- a/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c +++ b/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to do a non-circular RCU linked list * traversal, safely against concurrent RCU updates. */ diff --git a/doc/examples/hlist/cds_hlist_for_each_rcu.c b/doc/examples/hlist/cds_hlist_for_each_rcu.c index 1628c66..4642054 100644 --- a/doc/examples/hlist/cds_hlist_for_each_rcu.c +++ b/doc/examples/hlist/cds_hlist_for_each_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to do a non-circular RCU linked list * traversal, safely against concurrent RCU updates. * cds_hlist_for_each_rcu() iterates on struct cds_hlist_node, and thus, diff --git a/doc/examples/lfstack/Makefile b/doc/examples/lfstack/Makefile index 42398ed..189a7bd 100644 --- a/doc/examples/lfstack/Makefile +++ b/doc/examples/lfstack/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/lfstack/Makefile.cds_lfs_pop_all_blocking b/doc/examples/lfstack/Makefile.cds_lfs_pop_all_blocking index 9ee48d5..07a07d7 100644 --- a/doc/examples/lfstack/Makefile.cds_lfs_pop_all_blocking +++ b/doc/examples/lfstack/Makefile.cds_lfs_pop_all_blocking @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfs_pop_all_blocking diff --git a/doc/examples/lfstack/Makefile.cds_lfs_pop_blocking b/doc/examples/lfstack/Makefile.cds_lfs_pop_blocking index da43458..f5fa1c8 100644 --- a/doc/examples/lfstack/Makefile.cds_lfs_pop_blocking +++ b/doc/examples/lfstack/Makefile.cds_lfs_pop_blocking @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfs_pop_blocking diff --git a/doc/examples/lfstack/Makefile.cds_lfs_push b/doc/examples/lfstack/Makefile.cds_lfs_push index a2078c4..8908afe 100644 --- a/doc/examples/lfstack/Makefile.cds_lfs_push +++ b/doc/examples/lfstack/Makefile.cds_lfs_push @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfs_push diff --git a/doc/examples/lfstack/cds_lfs_pop_all_blocking.c b/doc/examples/lfstack/cds_lfs_pop_all_blocking.c index f6fcfb7..290fe80 100644 --- a/doc/examples/lfstack/cds_lfs_pop_all_blocking.c +++ b/doc/examples/lfstack/cds_lfs_pop_all_blocking.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to pop all nodes from a lfstack. */ diff --git a/doc/examples/lfstack/cds_lfs_pop_blocking.c b/doc/examples/lfstack/cds_lfs_pop_blocking.c index f356423..25d6381 100644 --- a/doc/examples/lfstack/cds_lfs_pop_blocking.c +++ b/doc/examples/lfstack/cds_lfs_pop_blocking.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to pop nodes from a lfstack. */ diff --git a/doc/examples/lfstack/cds_lfs_push.c b/doc/examples/lfstack/cds_lfs_push.c index bdb160f..b3c5b93 100644 --- a/doc/examples/lfstack/cds_lfs_push.c +++ b/doc/examples/lfstack/cds_lfs_push.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to push nodes into a lfstack. */ diff --git a/doc/examples/list/Makefile b/doc/examples/list/Makefile index 79a09e3..034a593 100644 --- a/doc/examples/list/Makefile +++ b/doc/examples/list/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/list/Makefile.cds_list_add_rcu b/doc/examples/list/Makefile.cds_list_add_rcu index faf2c94..91ab903 100644 --- a/doc/examples/list/Makefile.cds_list_add_rcu +++ b/doc/examples/list/Makefile.cds_list_add_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_add_rcu diff --git a/doc/examples/list/Makefile.cds_list_add_tail_rcu b/doc/examples/list/Makefile.cds_list_add_tail_rcu index 3031024..6a60c03 100644 --- a/doc/examples/list/Makefile.cds_list_add_tail_rcu +++ b/doc/examples/list/Makefile.cds_list_add_tail_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_add_tail_rcu diff --git a/doc/examples/list/Makefile.cds_list_del_rcu b/doc/examples/list/Makefile.cds_list_del_rcu index 74cef2b..1509267 100644 --- a/doc/examples/list/Makefile.cds_list_del_rcu +++ b/doc/examples/list/Makefile.cds_list_del_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_del_rcu diff --git a/doc/examples/list/Makefile.cds_list_for_each_entry_rcu b/doc/examples/list/Makefile.cds_list_for_each_entry_rcu index 911301e..af08056 100644 --- a/doc/examples/list/Makefile.cds_list_for_each_entry_rcu +++ b/doc/examples/list/Makefile.cds_list_for_each_entry_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_for_each_entry_rcu diff --git a/doc/examples/list/Makefile.cds_list_for_each_rcu b/doc/examples/list/Makefile.cds_list_for_each_rcu index 2f2f02f..54bb040 100644 --- a/doc/examples/list/Makefile.cds_list_for_each_rcu +++ b/doc/examples/list/Makefile.cds_list_for_each_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_for_each_rcu diff --git a/doc/examples/list/Makefile.cds_list_replace_rcu b/doc/examples/list/Makefile.cds_list_replace_rcu index 5e130b3..a7cc56d 100644 --- a/doc/examples/list/Makefile.cds_list_replace_rcu +++ b/doc/examples/list/Makefile.cds_list_replace_rcu @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_list_replace_rcu diff --git a/doc/examples/list/cds_list_add_rcu.c b/doc/examples/list/cds_list_add_rcu.c index 3eb062a..13da5b3 100644 --- a/doc/examples/list/cds_list_add_rcu.c +++ b/doc/examples/list/cds_list_add_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add into a linked-list safely against * concurrent RCU traversals. */ diff --git a/doc/examples/list/cds_list_add_tail_rcu.c b/doc/examples/list/cds_list_add_tail_rcu.c index f7490af..475cf66 100644 --- a/doc/examples/list/cds_list_add_tail_rcu.c +++ b/doc/examples/list/cds_list_add_tail_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add into tail of a linked-list safely * against concurrent RCU traversals. */ diff --git a/doc/examples/list/cds_list_del_rcu.c b/doc/examples/list/cds_list_del_rcu.c index d6b3ab0..b4e4c13 100644 --- a/doc/examples/list/cds_list_del_rcu.c +++ b/doc/examples/list/cds_list_del_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to remove from a linked-list safely against * concurrent RCU traversals. */ diff --git a/doc/examples/list/cds_list_for_each_entry_rcu.c b/doc/examples/list/cds_list_for_each_entry_rcu.c index 5deb4a5..ef9e954 100644 --- a/doc/examples/list/cds_list_for_each_entry_rcu.c +++ b/doc/examples/list/cds_list_for_each_entry_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to do a RCU linked list traversal, safely * against concurrent RCU updates. */ diff --git a/doc/examples/list/cds_list_for_each_rcu.c b/doc/examples/list/cds_list_for_each_rcu.c index 2e66719..044aa5e 100644 --- a/doc/examples/list/cds_list_for_each_rcu.c +++ b/doc/examples/list/cds_list_for_each_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to do a RCU linked list traversal, safely * against concurrent RCU updates. cds_list_for_each_rcu() iterates on * struct cds_list_head, and thus, either caa_container_of() or diff --git a/doc/examples/list/cds_list_replace_rcu.c b/doc/examples/list/cds_list_replace_rcu.c index aa6161c..d17084b 100644 --- a/doc/examples/list/cds_list_replace_rcu.c +++ b/doc/examples/list/cds_list_replace_rcu.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to replace a node within a linked-list safely * against concurrent RCU traversals. */ diff --git a/doc/examples/rculfhash/Makefile b/doc/examples/rculfhash/Makefile index c64f40a..29b28f7 100644 --- a/doc/examples/rculfhash/Makefile +++ b/doc/examples/rculfhash/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_add b/doc/examples/rculfhash/Makefile.cds_lfht_add index 9fab2b6..45333f5 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_add +++ b/doc/examples/rculfhash/Makefile.cds_lfht_add @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_add diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_add_replace b/doc/examples/rculfhash/Makefile.cds_lfht_add_replace index dcd253a..6147a41 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_add_replace +++ b/doc/examples/rculfhash/Makefile.cds_lfht_add_replace @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_add_replace diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_add_unique b/doc/examples/rculfhash/Makefile.cds_lfht_add_unique index c74c61e..a1772d3 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_add_unique +++ b/doc/examples/rculfhash/Makefile.cds_lfht_add_unique @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_add_unique diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_del b/doc/examples/rculfhash/Makefile.cds_lfht_del index 6377490..982b0f7 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_del +++ b/doc/examples/rculfhash/Makefile.cds_lfht_del @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_del diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_destroy b/doc/examples/rculfhash/Makefile.cds_lfht_destroy index d797893..deda37a 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_destroy +++ b/doc/examples/rculfhash/Makefile.cds_lfht_destroy @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_destroy diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_for_each_entry_duplicate b/doc/examples/rculfhash/Makefile.cds_lfht_for_each_entry_duplicate index 7020b14..fd5d38d 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_for_each_entry_duplicate +++ b/doc/examples/rculfhash/Makefile.cds_lfht_for_each_entry_duplicate @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_for_each_entry_duplicate diff --git a/doc/examples/rculfhash/Makefile.cds_lfht_lookup b/doc/examples/rculfhash/Makefile.cds_lfht_lookup index 79eb6c4..8330c9c 100644 --- a/doc/examples/rculfhash/Makefile.cds_lfht_lookup +++ b/doc/examples/rculfhash/Makefile.cds_lfht_lookup @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfht_lookup diff --git a/doc/examples/rculfhash/cds_lfht_add.c b/doc/examples/rculfhash/cds_lfht_add.c index 67b00f4..927e38d 100644 --- a/doc/examples/rculfhash/cds_lfht_add.c +++ b/doc/examples/rculfhash/cds_lfht_add.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add nodes (allowing duplicate keys) into a * RCU lock-free hash table. * This hash table requires using a RCU scheme. diff --git a/doc/examples/rculfhash/cds_lfht_add_replace.c b/doc/examples/rculfhash/cds_lfht_add_replace.c index 363ea5b..ecab570 100644 --- a/doc/examples/rculfhash/cds_lfht_add_replace.c +++ b/doc/examples/rculfhash/cds_lfht_add_replace.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add nodes into a RCU lock-free hash table * with cds_lfht_add_replace(), which replaces existing nodes with the * same key if found. diff --git a/doc/examples/rculfhash/cds_lfht_add_unique.c b/doc/examples/rculfhash/cds_lfht_add_unique.c index d6044c2..326e19b 100644 --- a/doc/examples/rculfhash/cds_lfht_add_unique.c +++ b/doc/examples/rculfhash/cds_lfht_add_unique.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to add unique nodes into a RCU lock-free hash * table. We use a "seqnum" field to show which node is staying in the * hash table. This hash table requires using a RCU scheme. diff --git a/doc/examples/rculfhash/cds_lfht_del.c b/doc/examples/rculfhash/cds_lfht_del.c index 9dab8a5..4eb3486 100644 --- a/doc/examples/rculfhash/cds_lfht_del.c +++ b/doc/examples/rculfhash/cds_lfht_del.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to remove nodes from a RCU lock-free hash table. * This hash table requires using a RCU scheme. */ diff --git a/doc/examples/rculfhash/cds_lfht_destroy.c b/doc/examples/rculfhash/cds_lfht_destroy.c index 56b9df6..f0c8219 100644 --- a/doc/examples/rculfhash/cds_lfht_destroy.c +++ b/doc/examples/rculfhash/cds_lfht_destroy.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to use cds_lfht_destroy() to clear memory used * by a a RCU lock-free hash table. This hash table requires using a * RCU scheme. diff --git a/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c b/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c index 00ebfa1..14f39e1 100644 --- a/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c +++ b/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to iterate on duplicate keys within a RCU * lock-free hash table. This hash table requires using a RCU scheme. */ diff --git a/doc/examples/rculfhash/cds_lfht_lookup.c b/doc/examples/rculfhash/cds_lfht_lookup.c index 8eeacf7..6b06095 100644 --- a/doc/examples/rculfhash/cds_lfht_lookup.c +++ b/doc/examples/rculfhash/cds_lfht_lookup.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to lookup keys within a RCU lock-free hash * table. This hash table requires using a RCU scheme. */ diff --git a/doc/examples/rculfhash/jhash.h b/doc/examples/rculfhash/jhash.h index f50a0da..23812ce 100644 --- a/doc/examples/rculfhash/jhash.h +++ b/doc/examples/rculfhash/jhash.h @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + #ifndef _JHASH_H #define _JHASH_H @@ -6,20 +10,7 @@ #endif /* - * jhash.h - * * Example hash function. - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. */ /* diff --git a/doc/examples/rculfqueue/Makefile b/doc/examples/rculfqueue/Makefile index b964d23..445a3ad 100644 --- a/doc/examples/rculfqueue/Makefile +++ b/doc/examples/rculfqueue/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/rculfqueue/Makefile.cds_lfq_dequeue b/doc/examples/rculfqueue/Makefile.cds_lfq_dequeue index c083873..e893b5b 100644 --- a/doc/examples/rculfqueue/Makefile.cds_lfq_dequeue +++ b/doc/examples/rculfqueue/Makefile.cds_lfq_dequeue @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfq_dequeue diff --git a/doc/examples/rculfqueue/Makefile.cds_lfq_enqueue b/doc/examples/rculfqueue/Makefile.cds_lfq_enqueue index b8f1ff5..c84c5c4 100644 --- a/doc/examples/rculfqueue/Makefile.cds_lfq_enqueue +++ b/doc/examples/rculfqueue/Makefile.cds_lfq_enqueue @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_lfq_enqueue diff --git a/doc/examples/rculfqueue/cds_lfq_dequeue.c b/doc/examples/rculfqueue/cds_lfq_dequeue.c index e81e105..67d766a 100644 --- a/doc/examples/rculfqueue/cds_lfq_dequeue.c +++ b/doc/examples/rculfqueue/cds_lfq_dequeue.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to dequeue nodes from a RCU lock-free queue. * This queue requires using a RCU scheme. */ diff --git a/doc/examples/rculfqueue/cds_lfq_enqueue.c b/doc/examples/rculfqueue/cds_lfq_enqueue.c index 1202467..b0ea030 100644 --- a/doc/examples/rculfqueue/cds_lfq_enqueue.c +++ b/doc/examples/rculfqueue/cds_lfq_enqueue.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to enqueue nodes into a RCU lock-free queue. * This queue requires using a RCU scheme. */ diff --git a/doc/examples/urcu-flavors/Makefile b/doc/examples/urcu-flavors/Makefile index fedadb2..6738eaf 100644 --- a/doc/examples/urcu-flavors/Makefile +++ b/doc/examples/urcu-flavors/Makefile @@ -1,21 +1,13 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: $(AM_V_at)$(MAKE) -f Makefile.qsbr $(AM_V_at)$(MAKE) -f Makefile.mb $(AM_V_at)$(MAKE) -f Makefile.membarrier - $(AM_V_at)$(MAKE) -f Makefile.signal $(AM_V_at)$(MAKE) -f Makefile.bp .PHONY: clean @@ -23,5 +15,4 @@ clean: $(AM_V_at)$(MAKE) -f Makefile.qsbr clean $(AM_V_at)$(MAKE) -f Makefile.mb clean $(AM_V_at)$(MAKE) -f Makefile.membarrier clean - $(AM_V_at)$(MAKE) -f Makefile.signal clean $(AM_V_at)$(MAKE) -f Makefile.bp clean diff --git a/doc/examples/urcu-flavors/Makefile.bp b/doc/examples/urcu-flavors/Makefile.bp index 5170f02..b42fe4d 100644 --- a/doc/examples/urcu-flavors/Makefile.bp +++ b/doc/examples/urcu-flavors/Makefile.bp @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = bp diff --git a/doc/examples/urcu-flavors/Makefile.mb b/doc/examples/urcu-flavors/Makefile.mb index 7a4e2f9..b5d9ffb 100644 --- a/doc/examples/urcu-flavors/Makefile.mb +++ b/doc/examples/urcu-flavors/Makefile.mb @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = mb diff --git a/doc/examples/urcu-flavors/Makefile.membarrier b/doc/examples/urcu-flavors/Makefile.membarrier index 977078e..64dfceb 100644 --- a/doc/examples/urcu-flavors/Makefile.membarrier +++ b/doc/examples/urcu-flavors/Makefile.membarrier @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = membarrier diff --git a/doc/examples/urcu-flavors/Makefile.qsbr b/doc/examples/urcu-flavors/Makefile.qsbr index dc28ddd..b50ce82 100644 --- a/doc/examples/urcu-flavors/Makefile.qsbr +++ b/doc/examples/urcu-flavors/Makefile.qsbr @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = qsbr diff --git a/doc/examples/urcu-flavors/Makefile.signal b/doc/examples/urcu-flavors/Makefile.signal deleted file mode 100644 index 6e2c0db..0000000 --- a/doc/examples/urcu-flavors/Makefile.signal +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. -# -# This makefile is purposefully kept simple to support GNU and BSD make. - -EXAMPLE_NAME = signal - -SOURCES = $(EXAMPLE_NAME).c -OBJECTS = $(EXAMPLE_NAME).o -BINARY = $(EXAMPLE_NAME) -LIBS = -lurcu-signal - -include ../Makefile.examples.template diff --git a/doc/examples/urcu-flavors/bp.c b/doc/examples/urcu-flavors/bp.c index 9032b9b..d423733 100644 --- a/doc/examples/urcu-flavors/bp.c +++ b/doc/examples/urcu-flavors/bp.c @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2013 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later #include #include @@ -46,7 +32,7 @@ int add_node(uint64_t v) { struct mynode *node; - node = calloc(sizeof(*node), 1); + node = calloc(1, sizeof(*node)); if (!node) return -1; node->value = v; diff --git a/doc/examples/urcu-flavors/mb.c b/doc/examples/urcu-flavors/mb.c index 5280598..7069c24 100644 --- a/doc/examples/urcu-flavors/mb.c +++ b/doc/examples/urcu-flavors/mb.c @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2013 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later #include #include @@ -47,7 +33,7 @@ int add_node(uint64_t v) { struct mynode *node; - node = calloc(sizeof(*node), 1); + node = calloc(1, sizeof(*node)); if (!node) return -1; node->value = v; diff --git a/doc/examples/urcu-flavors/membarrier.c b/doc/examples/urcu-flavors/membarrier.c index 2e84734..73b9bd8 100644 --- a/doc/examples/urcu-flavors/membarrier.c +++ b/doc/examples/urcu-flavors/membarrier.c @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2013 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later #include #include @@ -47,7 +33,7 @@ int add_node(uint64_t v) { struct mynode *node; - node = calloc(sizeof(*node), 1); + node = calloc(1, sizeof(*node)); if (!node) return -1; node->value = v; diff --git a/doc/examples/urcu-flavors/qsbr.c b/doc/examples/urcu-flavors/qsbr.c index 661ecae..ca00933 100644 --- a/doc/examples/urcu-flavors/qsbr.c +++ b/doc/examples/urcu-flavors/qsbr.c @@ -1,20 +1,6 @@ -/* - * Copyright (C) 2013 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later #include #include @@ -46,7 +32,7 @@ int add_node(uint64_t v) { struct mynode *node; - node = calloc(sizeof(*node), 1); + node = calloc(1, sizeof(*node)); if (!node) return -1; node->value = v; diff --git a/doc/examples/urcu-flavors/signal.c b/doc/examples/urcu-flavors/signal.c deleted file mode 100644 index c0a35b9..0000000 --- a/doc/examples/urcu-flavors/signal.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2013 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include - -#include /* Signal-based RCU flavor */ -#include /* List example */ -#include /* For CAA_ARRAY_SIZE */ - -/* - * Example showing how to use the signal-based Userspace RCU flavor. - * - * This is a mock-up example where updates and RCU traversals are - * performed by the same thread to keep things simple on purpose. - */ - -static CDS_LIST_HEAD(mylist); - -struct mynode { - uint64_t value; - struct cds_list_head node; /* linked-list chaining */ - struct rcu_head rcu_head; /* for call_rcu() */ -}; - -static -int add_node(uint64_t v) -{ - struct mynode *node; - - node = calloc(sizeof(*node), 1); - if (!node) - return -1; - node->value = v; - cds_list_add_rcu(&node->node, &mylist); - return 0; -} - -static -void rcu_free_node(struct rcu_head *rh) -{ - struct mynode *node = caa_container_of(rh, struct mynode, rcu_head); - - free(node); -} - -int main(void) -{ - uint64_t values[] = { 42, 36, 24, }; - unsigned int i; - int ret; - struct mynode *node, *n; - - /* - * Each thread need using RCU read-side need to be explicitly - * registered. - */ - urcu_signal_register_thread(); - - /* - * Adding nodes to the linked-list. Safe against concurrent - * RCU traversals, require mutual exclusion with list updates. - */ - for (i = 0; i < CAA_ARRAY_SIZE(values); i++) { - ret = add_node(values[i]); - if (ret) - goto end; - } - - /* - * We need to explicitly mark RCU read-side critical sections - * with rcu_read_lock() and rcu_read_unlock(). They can be - * nested. Those are no-ops for the QSBR flavor. - */ - urcu_signal_read_lock(); - - /* - * RCU traversal of the linked list. - */ - cds_list_for_each_entry_rcu(node, &mylist, node) { - printf("Value: %" PRIu64 "\n", node->value); - } - urcu_signal_read_unlock(); - - /* - * Removing nodes from linked list. Safe against concurrent RCU - * traversals, require mutual exclusion with list updates. - */ - cds_list_for_each_entry_safe(node, n, &mylist, node) { - cds_list_del_rcu(&node->node); - /* - * call_rcu() will ensure that the handler - * "rcu_free_node" is executed after a grace period. - * call_rcu() can be called from RCU read-side critical - * sections. - */ - urcu_signal_call_rcu(&node->rcu_head, rcu_free_node); - } - - /* - * We can also wait for a quiescent state by calling - * synchronize_rcu() rather than using call_rcu(). It is usually - * a slower approach than call_rcu(), because the latter can - * batch work. Moreover, call_rcu() can be called from a RCU - * read-side critical section, but synchronize_rcu() should not. - */ - urcu_signal_synchronize_rcu(); - - sleep(1); - - /* - * Waiting for previously called call_rcu handlers to complete - * before program exits, or in library destructors, is a good - * practice. - */ - urcu_signal_barrier(); - -end: - urcu_signal_unregister_thread(); - return ret; -} diff --git a/doc/examples/wfcqueue/Makefile b/doc/examples/wfcqueue/Makefile index 4f0338e..317985d 100644 --- a/doc/examples/wfcqueue/Makefile +++ b/doc/examples/wfcqueue/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/wfcqueue/Makefile.cds_wfcq_dequeue b/doc/examples/wfcqueue/Makefile.cds_wfcq_dequeue index 4f80a71..bbb303d 100644 --- a/doc/examples/wfcqueue/Makefile.cds_wfcq_dequeue +++ b/doc/examples/wfcqueue/Makefile.cds_wfcq_dequeue @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfcq_dequeue diff --git a/doc/examples/wfcqueue/Makefile.cds_wfcq_enqueue b/doc/examples/wfcqueue/Makefile.cds_wfcq_enqueue index aef5105..1145756 100644 --- a/doc/examples/wfcqueue/Makefile.cds_wfcq_enqueue +++ b/doc/examples/wfcqueue/Makefile.cds_wfcq_enqueue @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfcq_enqueue diff --git a/doc/examples/wfcqueue/Makefile.cds_wfcq_splice b/doc/examples/wfcqueue/Makefile.cds_wfcq_splice index 76b9f0a..17da52a 100644 --- a/doc/examples/wfcqueue/Makefile.cds_wfcq_splice +++ b/doc/examples/wfcqueue/Makefile.cds_wfcq_splice @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfcq_splice diff --git a/doc/examples/wfcqueue/cds_wfcq_dequeue.c b/doc/examples/wfcqueue/cds_wfcq_dequeue.c index 41a7baa..01a34a5 100644 --- a/doc/examples/wfcqueue/cds_wfcq_dequeue.c +++ b/doc/examples/wfcqueue/cds_wfcq_dequeue.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to dequeue nodes from a wfcqueue. */ diff --git a/doc/examples/wfcqueue/cds_wfcq_enqueue.c b/doc/examples/wfcqueue/cds_wfcq_enqueue.c index 850eea8..374ca72 100644 --- a/doc/examples/wfcqueue/cds_wfcq_enqueue.c +++ b/doc/examples/wfcqueue/cds_wfcq_enqueue.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to enqueue nodes into a wfcqueue. */ diff --git a/doc/examples/wfcqueue/cds_wfcq_splice.c b/doc/examples/wfcqueue/cds_wfcq_splice.c index cb6f76b..5e369e8 100644 --- a/doc/examples/wfcqueue/cds_wfcq_splice.c +++ b/doc/examples/wfcqueue/cds_wfcq_splice.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to splice nodes from a source wfcqueue A into * a destination wfcqueue B. */ diff --git a/doc/examples/wfstack/Makefile b/doc/examples/wfstack/Makefile index 098fb94..a0be0da 100644 --- a/doc/examples/wfstack/Makefile +++ b/doc/examples/wfstack/Makefile @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. all: diff --git a/doc/examples/wfstack/Makefile.cds_wfs_pop b/doc/examples/wfstack/Makefile.cds_wfs_pop index 24df951..69e91ff 100644 --- a/doc/examples/wfstack/Makefile.cds_wfs_pop +++ b/doc/examples/wfstack/Makefile.cds_wfs_pop @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfs_pop diff --git a/doc/examples/wfstack/Makefile.cds_wfs_pop_all_blocking b/doc/examples/wfstack/Makefile.cds_wfs_pop_all_blocking index 452fd9c..164c89b 100644 --- a/doc/examples/wfstack/Makefile.cds_wfs_pop_all_blocking +++ b/doc/examples/wfstack/Makefile.cds_wfs_pop_all_blocking @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfs_pop_all_blocking diff --git a/doc/examples/wfstack/Makefile.cds_wfs_push b/doc/examples/wfstack/Makefile.cds_wfs_push index 43f96c1..e29a35f 100644 --- a/doc/examples/wfstack/Makefile.cds_wfs_push +++ b/doc/examples/wfstack/Makefile.cds_wfs_push @@ -1,14 +1,7 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. EXAMPLE_NAME = cds_wfs_push diff --git a/doc/examples/wfstack/cds_wfs_pop.c b/doc/examples/wfstack/cds_wfs_pop.c index 68b81b9..93809ef 100644 --- a/doc/examples/wfstack/cds_wfs_pop.c +++ b/doc/examples/wfstack/cds_wfs_pop.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to pop nodes from a wfstack. */ diff --git a/doc/examples/wfstack/cds_wfs_pop_all_blocking.c b/doc/examples/wfstack/cds_wfs_pop_all_blocking.c index 794ced1..a9cc4ca 100644 --- a/doc/examples/wfstack/cds_wfs_pop_all_blocking.c +++ b/doc/examples/wfstack/cds_wfs_pop_all_blocking.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to pop all nodes from a wfstack. */ diff --git a/doc/examples/wfstack/cds_wfs_push.c b/doc/examples/wfstack/cds_wfs_push.c index 42bc5ec..69eb6ca 100644 --- a/doc/examples/wfstack/cds_wfs_push.c +++ b/doc/examples/wfstack/cds_wfs_push.c @@ -1,15 +1,8 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + /* - * Copyright (C) 2013 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - * * This example shows how to push nodes into a wfstack. */ diff --git a/doc/rcu-api.md b/doc/rcu-api.md index e8ec022..b305fcf 100644 --- a/doc/rcu-api.md +++ b/doc/rcu-api.md @@ -1,3 +1,9 @@ + + Userspace RCU API ================= @@ -60,6 +66,31 @@ started: this is not a reader-writer lock. The duration actually waited is called an RCU grace period. +```c +struct urcu_gp_poll_state start_poll_synchronize_rcu(void); +``` + +Provides a handle for checking if a new grace period has started +and completed since the handle was obtained. It returns a +`struct urcu_gp_poll_state` handle that can be used with +`poll_state_synchronize_rcu` to check, by polling, if the +associated grace period has completed. + +`start_poll_synchronize_rcu` must only be called from +registered RCU read-side threads. For the QSBR flavor, the +caller must be online. + + +```c +bool poll_state_synchronize_rcu(struct urcu_gp_poll_state state); +``` + +Checks if the grace period associated with the +`struct urcu_gp_poll_state` handle has completed. If the grace +period has completed, the function returns true. Otherwise, +it returns false. + + ```c void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)); diff --git a/doc/solaris-build.md b/doc/solaris-build.md index a5bbdef..1a0c68c 100644 --- a/doc/solaris-build.md +++ b/doc/solaris-build.md @@ -1,3 +1,9 @@ + + # Solaris support ## Solaris 10 ### Dependencies @@ -20,7 +26,7 @@ And the following OpenCSW packages are required : * gsed * gmake * pkgconfig -* libglib2_dev +* libglib2\_dev * gcc4core ### Build diff --git a/doc/uatomic-api.md b/doc/uatomic-api.md index 9dd0c1c..6421708 100644 --- a/doc/uatomic-api.md +++ b/doc/uatomic-api.md @@ -1,3 +1,9 @@ + + Userspace RCU Atomic Operations API =================================== @@ -27,7 +33,7 @@ API --- ```c -void uatomic_set(type *addr, type v) +void uatomic_set(type *addr, type v); ``` Atomically write `v` into `addr`. By "atomically", we mean that no @@ -36,7 +42,7 @@ effects of `uatomic_set()`. ```c -type uatomic_read(type *addr) +type uatomic_read(type *addr); ``` Atomically read `v` from `addr`. By "atomically", we mean that @@ -45,18 +51,19 @@ uatomic update. ```c -type uatomic_cmpxchg(type *addr, type old, type new) +type uatomic_cmpxchg(type *addr, type old, type new); ``` An atomic read-modify-write operation that performs this sequence of operations atomically: check if `addr` contains `old`. If true, then replace the content of `addr` by `new`. Return the value previously contained by `addr`. This function implies a full -memory barrier before and after the atomic operation. +memory barrier before and after the atomic operation on success. +On failure, no memory order is guaranteed. ```c -type uatomic_xchg(type *addr, type new) +type uatomic_xchg(type *addr, type new); ``` An atomic read-modify-write operation that performs this sequence @@ -67,8 +74,8 @@ operation. ```c -type uatomic_add_return(type *addr, type v) -type uatomic_sub_return(type *addr, type v) +type uatomic_add_return(type *addr, type v); +type uatomic_sub_return(type *addr, type v); ``` An atomic read-modify-write operation that performs this @@ -79,8 +86,8 @@ operation. ```c -void uatomic_and(type *addr, type mask) -void uatomic_or(type *addr, type mask) +void uatomic_and(type *addr, type mask); +void uatomic_or(type *addr, type mask); ``` Atomically write the result of bitwise "and"/"or" between the @@ -95,8 +102,8 @@ atomic instructions implicitly supply the needed memory barriers. ```c -void uatomic_add(type *addr, type v) -void uatomic_sub(type *addr, type v) +void uatomic_add(type *addr, type v); +void uatomic_sub(type *addr, type v); ``` Atomically increment/decrement the content of `addr` by `v`. @@ -110,8 +117,8 @@ instructions implicitly supply the needed memory barriers. ```c -void uatomic_inc(type *addr) -void uatomic_dec(type *addr) +void uatomic_inc(type *addr); +void uatomic_dec(type *addr); ``` Atomically increment/decrement the content of `addr` by 1. diff --git a/extras/Makefile.am b/extras/Makefile.am index 8a9d7fd..514c889 100644 --- a/extras/Makefile.am +++ b/extras/Makefile.am @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-only +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT # Directories added to EXTRA_DIST will be recursively copied to the distribution. EXTRA_DIST = $(srcdir)/abi diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml index 311c49f..044f276 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -106,171 +114,265 @@ - - - - - - - - - - - - - - - - - - - - + + + - + + + + + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -278,7 +380,7 @@ - + @@ -286,11 +388,11 @@ - + - + @@ -298,595 +400,501 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml index 681e7e6..bcdb9db 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml @@ -1,6 +1,10 @@ + - @@ -13,6 +17,10 @@ + + + + @@ -121,36 +129,38 @@ - - - - - + - + - + + + + + - + - + - + - + + + @@ -169,72 +179,70 @@ - - - - - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -245,6 +253,8 @@ + + @@ -252,8 +262,6 @@ - - @@ -270,248 +278,248 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - + + + + + + - - + + - - + + - + - + + + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - - - + + + + + + + + + + + + + + + + + + - + + + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -527,7 +535,7 @@ - + @@ -535,7 +543,7 @@ - + @@ -543,11 +551,11 @@ - + - + @@ -597,140 +605,140 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + - - - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -748,738 +756,738 @@ - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - + + + + + + + - + - + - + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - + - + - + - + - - + + + + + + + + - + - + - + + + + + + + + + + + + - + - + - + - - + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + + + + + - + - + - + - + - + + + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-common.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-common.so.6.xml index 07daf21..e7aef91 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-common.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-common.so.6.xml @@ -1,4 +1,9 @@ + @@ -40,6 +45,10 @@ + + + + @@ -108,449 +117,449 @@ - - - - - - - - - - - - - - - - - - - - - - + - + + + - + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - - - - - + - + - - - - + + + + - - + + - - + + - + - + + + - + - + - + + + + + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -568,16 +577,18 @@ - - - - + + + + + + - + - + @@ -585,64 +596,62 @@ - + + + - + - + - + - - - - - - - + + + - + - + - + - + - + - + - + - + @@ -651,14 +660,14 @@ - + - + - + @@ -670,14 +679,14 @@ - + - + @@ -686,14 +695,14 @@ - + - + @@ -707,195 +716,195 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml index f28b67c..3ce07d1 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -94,750 +102,750 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml index f57eae2..c1ee196 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -100,765 +108,765 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml index e3078f7..4f9ffcc 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -96,755 +104,755 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu.so.6.xml b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu.so.6.xml index 562d4d2..566ccbf 100644 --- a/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu.so.6.xml +++ b/extras/abi/0.10/x86_64-pc-linux-gnu/liburcu.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -96,183 +104,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -280,7 +384,7 @@ - + @@ -288,11 +392,11 @@ - + - + @@ -300,548 +404,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml index 9549700..312bc93 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -184,171 +192,265 @@ - - - - - - - - - - - - - - - - - - - - + + + - + + + + + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -356,7 +458,7 @@ - + @@ -364,11 +466,11 @@ - + - + @@ -376,595 +478,501 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml index 6da0790..a085bee 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml @@ -1,6 +1,10 @@ + - @@ -13,6 +17,10 @@ + + + + @@ -119,36 +127,38 @@ - - - - - + - + - + + + + + - + - + - + - + + + @@ -167,72 +177,70 @@ - - - - - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -243,6 +251,8 @@ + + @@ -250,8 +260,6 @@ - - @@ -268,248 +276,248 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - + + + + + + - - + + - - + + - + - + + + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - - - + + + + + + + + + + + + + + + + + + - + + + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -525,7 +533,7 @@ - + @@ -533,7 +541,7 @@ - + @@ -541,11 +549,11 @@ - + - + @@ -595,140 +603,140 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + - - - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -746,727 +754,727 @@ - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - + + + + + + + - + - + - + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - + - + - + - + - - + + + + + + + + - + - + - + + + + + + + + + + + + - + - + - + - - + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + + + + + - + - + - + - + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-common.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-common.so.6.xml index 07daf21..e7aef91 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-common.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-common.so.6.xml @@ -1,4 +1,9 @@ + @@ -40,6 +45,10 @@ + + + + @@ -108,449 +117,449 @@ - - - - - - - - - - - - - - - - - - - - - - + - + + + - + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - - - - - + - + - - - - + + + + - - + + - - + + - + - + + + - + - + - + + + + + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -568,16 +577,18 @@ - - - - + + + + + + - + - + @@ -585,64 +596,62 @@ - + + + - + - + - + - - - - - - - + + + - + - + - + - + - + - + - + - + @@ -651,14 +660,14 @@ - + - + - + @@ -670,14 +679,14 @@ - + - + @@ -686,14 +695,14 @@ - + - + @@ -707,195 +716,195 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml index 95c4c19..400eb0b 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -162,750 +170,750 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml index b97b4c4..e22c578 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,183 +174,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -350,7 +454,7 @@ - + @@ -358,11 +462,11 @@ - + - + @@ -370,548 +474,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml index 7279983..f0b9ce6 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -174,765 +182,765 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml index 3fecad8..feaa997 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,755 +174,755 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu.so.6.xml b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu.so.6.xml index a7722f6..3d42cd2 100644 --- a/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu.so.6.xml +++ b/extras/abi/0.11/x86_64-pc-linux-gnu/liburcu.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,183 +174,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -350,7 +454,7 @@ - + @@ -358,11 +462,11 @@ - + - + @@ -370,548 +474,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml index ccfa14f..df3f029 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-bp.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -186,171 +194,265 @@ - - - - - - - - - - - - - - - - - - - - + + + - + + + + + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -358,7 +460,7 @@ - + @@ -366,11 +468,11 @@ - + - + @@ -378,600 +480,506 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml index 5d9540c..ccfe923 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-cds.so.6.xml @@ -1,6 +1,10 @@ + - @@ -13,6 +17,10 @@ + + + + @@ -119,36 +127,38 @@ - - - - - + - + - + + + + + - + - + - + - + + + @@ -167,72 +177,70 @@ - - - - - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -243,6 +251,8 @@ + + @@ -250,8 +260,6 @@ - - @@ -268,248 +276,248 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - + + + + + + - - + + - - + + - + - + + + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - - - + + + + + + + + + + + + + + + + + + - + + + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -525,7 +533,7 @@ - + @@ -533,7 +541,7 @@ - + @@ -541,11 +549,11 @@ - + - + @@ -595,140 +603,140 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + - - - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -746,719 +754,731 @@ - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - + + + + + + + - + - + - + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - + - + - + - + - - + + + + + + + + - + - + - + + + + + + + + + + + + - + - + - + - - + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + + + + + - + - + - + - + - + + + - + - + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-common.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-common.so.6.xml index 07daf21..e7aef91 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-common.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-common.so.6.xml @@ -1,4 +1,9 @@ + @@ -40,6 +45,10 @@ + + + + @@ -108,449 +117,449 @@ - - - - - - - - - - - - - - - - - - - - - - + - + + + - + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - - - - - + - + - - - - + + + + - - + + - - + + - + - + + + - + - + - + + + + + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -568,16 +577,18 @@ - - - - + + + + + + - + - + @@ -585,64 +596,62 @@ - + + + - + - + - + - - - - - - - + + + - + - + - + - + - + - + - + - + @@ -651,14 +660,14 @@ - + - + - + @@ -670,14 +679,14 @@ - + - + @@ -686,14 +695,14 @@ - + - + @@ -707,195 +716,195 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml index 95c4c19..400eb0b 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-mb.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -162,750 +170,750 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml index b97b4c4..e22c578 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-memb.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,183 +174,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -350,7 +454,7 @@ - + @@ -358,11 +462,11 @@ - + - + @@ -370,548 +474,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml index 7279983..f0b9ce6 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-qsbr.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -174,765 +182,765 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml index 3fecad8..feaa997 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu-signal.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,755 +174,755 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu.so.6.xml b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu.so.6.xml index a7722f6..3d42cd2 100644 --- a/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu.so.6.xml +++ b/extras/abi/0.12/x86_64-pc-linux-gnu/liburcu.so.6.xml @@ -1,11 +1,19 @@ + - + + + + @@ -166,183 +174,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -350,7 +454,7 @@ - + @@ -358,11 +462,11 @@ - + - + @@ -370,548 +474,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml index 39be18b..7bc53cb 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -108,171 +116,265 @@ - - - - - - - - - - - - - - - - - - - - + + + - + + + + + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -280,7 +382,7 @@ - + @@ -288,11 +390,11 @@ - + - + @@ -300,600 +402,506 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml index fa7349c..ae03526 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml @@ -1,6 +1,10 @@ + - @@ -13,6 +17,10 @@ + + + + @@ -119,36 +127,38 @@ - - - - - + - + - + + + + + - + - + - + - + + + @@ -167,72 +177,70 @@ - - - - - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -243,6 +251,8 @@ + + @@ -250,8 +260,6 @@ - - @@ -268,248 +276,248 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - + + + + + + - - + + - - + + - + - + + + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + - + - + - + - - - - - - - + + + + + + + + + + + + + + + + + + - + + + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -525,7 +533,7 @@ - + @@ -533,7 +541,7 @@ - + @@ -541,11 +549,11 @@ - + - + @@ -595,140 +603,140 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + - - - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + @@ -746,731 +754,731 @@ - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - + + + + + + + - + - + - + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - + - + - + - + - - + + + + + + + + - + - + - + + + + + + + + + + + + - + - + - + - - + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + + + + + - + - + - + - + - + + + - + - + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-common.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-common.so.8.xml index 4b9f916..33bf1df 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-common.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-common.so.8.xml @@ -1,4 +1,9 @@ + @@ -40,6 +45,10 @@ + + + + @@ -108,449 +117,449 @@ - - - - - - - - - - - - - - - - - - - - - - + - + + + - + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + + + + + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - - - - - + - + - - - - + + + + - - + + - - + + - + - + + + - + - + - + + + + + - + - + - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -568,16 +577,18 @@ - - - - + + + + + + - + - + @@ -585,64 +596,62 @@ - + + + - + - + - + - - - - - - - + + + - + - + - + - + - + - + - + - + @@ -651,14 +660,14 @@ - + - + - + @@ -670,14 +679,14 @@ - + - + @@ -686,14 +695,14 @@ - + - + @@ -707,195 +716,195 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml index 80eba83..5ad4e9d 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -94,750 +102,750 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml index 56a91f9..ba5db9b 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -96,183 +104,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -280,7 +384,7 @@ - + @@ -288,11 +392,11 @@ - + - + @@ -300,548 +404,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml index 7d5e27a..0e350cc 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -100,765 +108,765 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml index 51a70ab..2aea310 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -96,755 +104,755 @@ - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + + + - + + + + + - + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu.so.8.xml b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu.so.8.xml index 98ff729..709f784 100644 --- a/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu.so.8.xml +++ b/extras/abi/0.13/x86_64-pc-linux-gnu/liburcu.so.8.xml @@ -1,11 +1,19 @@ + - + + + + @@ -96,183 +104,279 @@ - - - - - - - - - - - - - - - - - - - - + + + - + - + - - + + - + + + + + - + - + - + - + - + + + - + - + - + + + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -280,7 +384,7 @@ - + @@ -288,11 +392,11 @@ - + - + @@ -300,548 +404,452 @@ - + - + - + - + - + - + - - - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml new file mode 100644 index 0000000..2bd8607 --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-bp.so.8.xml @@ -0,0 +1,907 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml new file mode 100644 index 0000000..b0cb83c --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-cds.so.8.xml @@ -0,0 +1,1493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-common.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-common.so.8.xml new file mode 100644 index 0000000..95bd363 --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-common.so.8.xml @@ -0,0 +1,910 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml new file mode 100644 index 0000000..d8e736d --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-mb.so.8.xml @@ -0,0 +1,851 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml new file mode 100644 index 0000000..7df5cad --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml @@ -0,0 +1,855 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml new file mode 100644 index 0000000..848eb7a --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-qsbr.so.8.xml @@ -0,0 +1,872 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml new file mode 100644 index 0000000..0321432 --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu-signal.so.8.xml @@ -0,0 +1,858 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu.so.8.xml b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu.so.8.xml new file mode 100644 index 0000000..e9bfeaa --- /dev/null +++ b/extras/abi/0.14/x86_64-pc-linux-gnu/liburcu.so.8.xml @@ -0,0 +1,855 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-bp.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-bp.so.4.xml index bb66e83..0ee16cb 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-bp.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-bp.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-cds.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-cds.so.4.xml index 3e8b63f..58a6a9b 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-cds.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-cds.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-common.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-common.so.4.xml index 38e5b4c..73fe288 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-common.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-common.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-mb.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-mb.so.4.xml index 29012e8..e09bed2 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-mb.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-mb.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-qsbr.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-qsbr.so.4.xml index 79872eb..ad6c8ec 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-qsbr.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-qsbr.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-signal.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-signal.so.4.xml index 228800c..f61bc43 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-signal.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu-signal.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu.so.4.xml b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu.so.4.xml index d0ad504..612689b 100644 --- a/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu.so.4.xml +++ b/extras/abi/0.9/x86_64-pc-linux-gnu/liburcu.so.4.xml @@ -1,4 +1,9 @@ + diff --git a/extras/abi/README b/extras/abi/README deleted file mode 100644 index 4492fc6..0000000 --- a/extras/abi/README +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the serialized ABI definitions for a typical build of -the liburcu libraries. This information is extracted using libabigail -(https://sourceware.org/libabigail/). - -The artefacts used to generate these were built with CFLAGS="-O0 -ggdb". - -You can compare the serialized ABI with a shared object to check for breaking -changes. For example, here we compare an in-tree built version of -liburcu-memb.so with the serialized ABI of stable-0.13 : - - abidiff \ - extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.7.xml \ - src/.libs/liburcu-memb.so diff --git a/extras/abi/README.md b/extras/abi/README.md new file mode 100644 index 0000000..a7242a2 --- /dev/null +++ b/extras/abi/README.md @@ -0,0 +1,24 @@ + + +# Userspace-RCU ABI definitions + +This directory contains the serialized ABI definitions for a typical build of +the liburcu libraries. This information is extracted using +[libabigail](https://sourceware.org/libabigail/). + +The artefacts used to generate these were built with **CFLAGS="-O0 -ggdb"** on +an Ubuntu 18.04 x86_64 system. + +You can compare the serialized ABI with a shared object to check for breaking +changes. For example, here we compare an in-tree built version of +**liburcu-memb.so** with the serialized ABI of stable-0.13 : + +```` +abidiff \ + extras/abi/0.13/x86_64-pc-linux-gnu/liburcu-memb.so.8.xml \ + src/.libs/liburcu-memb.so +```` diff --git a/extras/abi/dump_abi.sh b/extras/abi/dump_abi.sh index e8aedcb..a7bd5fd 100755 --- a/extras/abi/dump_abi.sh +++ b/extras/abi/dump_abi.sh @@ -1,4 +1,7 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2021 Michael Jeanson +# # SPDX-License-Identifier: GPL-2.0-only set -eu @@ -11,11 +14,20 @@ ARGS=( "--no-corpus-path" # Do not put the path in the abi-corpus ) +# Older version of the reuse tool are a bit dumb, split the tags string to make +# it happy. +spdx="SPDX" +copyright="FileCopyrightText" +license="License-Identifier" + for lib in "${INDIR}"/liburcu*.so.? do abidw "${ARGS[@]}" --out-file "${OUTDIR}/$(basename "$lib").xml" "$lib" # Clean the full paths sed -i "s#$(pwd)/##g" "${OUTDIR}/$(basename "$lib").xml" + + # Add SPDX headers + sed -i "2 i " "${OUTDIR}/$(basename "$lib").xml" done diff --git a/gpl-2.0.txt b/gpl-2.0.txt deleted file mode 100644 index d511905..0000000 --- a/gpl-2.0.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/include/Makefile.am b/include/Makefile.am index b55bcf0..4c32a4c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,9 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + nobase_include_HEADERS = \ + urcu/annotate.h \ urcu/arch/aarch64.h \ urcu/arch/alpha.h \ urcu/arch/arm.h \ @@ -7,6 +12,7 @@ nobase_include_HEADERS = \ urcu/arch.h \ urcu/arch/hppa.h \ urcu/arch/ia64.h \ + urcu/arch/loongarch.h \ urcu/arch/m68k.h \ urcu/arch/mips.h \ urcu/arch/nios2.h \ @@ -33,7 +39,6 @@ nobase_include_HEADERS = \ urcu/map/urcu-mb.h \ urcu/map/urcu-memb.h \ urcu/map/urcu-qsbr.h \ - urcu/map/urcu-signal.h \ urcu/pointer.h \ urcu/rcuhlist.h \ urcu/rculfhash.h \ @@ -51,8 +56,6 @@ nobase_include_HEADERS = \ urcu/static/urcu-mb.h \ urcu/static/urcu-memb.h \ urcu/static/urcu-qsbr.h \ - urcu/static/urcu-signal.h \ - urcu/static/urcu-signal-nr.h \ urcu/static/wfcqueue.h \ urcu/static/wfqueue.h \ urcu/static/wfstack.h \ @@ -63,11 +66,14 @@ nobase_include_HEADERS = \ urcu/uatomic/alpha.h \ urcu/uatomic_arch.h \ urcu/uatomic/arm.h \ + urcu/uatomic/builtins.h \ + urcu/uatomic/builtins-generic.h \ urcu/uatomic/gcc.h \ urcu/uatomic/generic.h \ urcu/uatomic.h \ urcu/uatomic/hppa.h \ urcu/uatomic/ia64.h \ + urcu/uatomic/loongarch.h \ urcu/uatomic/m68k.h \ urcu/uatomic/mips.h \ urcu/uatomic/nios2.h \ @@ -84,10 +90,10 @@ nobase_include_HEADERS = \ urcu/urcu-memb.h \ urcu/urcu-qsbr.h \ urcu/urcu_ref.h \ - urcu/urcu-signal.h \ urcu/wfcqueue.h \ urcu/wfqueue.h \ - urcu/wfstack.h + urcu/wfstack.h \ + urcu/urcu-poll.h # Don't distribute generated headers nobase_nodist_include_HEADERS = urcu/config.h diff --git a/include/urcu-bp.h b/include/urcu-bp.h index acafee2..5f17e12 100644 --- a/include/urcu-bp.h +++ b/include/urcu-bp.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #define URCU_API_MAP #include diff --git a/include/urcu-call-rcu.h b/include/urcu-call-rcu.h index 162bc56..2d994e5 100644 --- a/include/urcu-call-rcu.h +++ b/include/urcu-call-rcu.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #include diff --git a/include/urcu-defer.h b/include/urcu-defer.h index e097d45..cd6bd9b 100644 --- a/include/urcu-defer.h +++ b/include/urcu-defer.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #include diff --git a/include/urcu-flavor.h b/include/urcu-flavor.h index aca264d..dbd70eb 100644 --- a/include/urcu-flavor.h +++ b/include/urcu-flavor.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #include diff --git a/include/urcu-pointer.h b/include/urcu-pointer.h index 97aed98..2e61c4d 100644 --- a/include/urcu-pointer.h +++ b/include/urcu-pointer.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #include diff --git a/include/urcu-qsbr.h b/include/urcu-qsbr.h index 43d95a9..1a0d0a1 100644 --- a/include/urcu-qsbr.h +++ b/include/urcu-qsbr.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #define URCU_API_MAP #include diff --git a/include/urcu.h b/include/urcu.h index 5599961..0bd5f23 100644 --- a/include/urcu.h +++ b/include/urcu.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2018 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #define URCU_API_MAP #include diff --git a/include/urcu/annotate.h b/include/urcu/annotate.h new file mode 100644 index 0000000..f0955a0 --- /dev/null +++ b/include/urcu/annotate.h @@ -0,0 +1,163 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef _URCU_ANNOTATE_H +#define _URCU_ANNOTATE_H + +/* + * urcu/annotate.h + * + * Userspace RCU - annotation header. + */ + +/* + * WARNING! + * + * This API is highly experimental. There is zero guarantees of stability + * between releases. + * + * You have been warned. + */ + +#include +#include + +#include + +enum cmm_annotate { + CMM_ANNOTATE_VOID, + CMM_ANNOTATE_LOAD, + CMM_ANNOTATE_STORE, + CMM_ANNOTATE_MB, +}; + +typedef enum cmm_annotate cmm_annotate_t __attribute__((unused)); + +#define cmm_annotate_define(name) \ + cmm_annotate_t name = CMM_ANNOTATE_VOID + +#ifdef CMM_SANITIZE_THREAD + +# ifdef __cplusplus +extern "C" { +# endif +extern void __tsan_acquire(void *); +extern void __tsan_release(void *); +# ifdef __cplusplus +} +# endif + +# define cmm_annotate_die(msg) \ + do { \ + fprintf(stderr, \ + "(" __FILE__ ":%s@%u) Annotation ERROR: %s\n", \ + __func__, __LINE__, msg); \ + abort(); \ + } while (0) + +/* Only used for typechecking in macros. */ +static inline cmm_annotate_t cmm_annotate_dereference(cmm_annotate_t *group) +{ + return *group; +} + +# define cmm_annotate_group_mb_acquire(group) \ + do { \ + switch (cmm_annotate_dereference(group)) { \ + case CMM_ANNOTATE_VOID: \ + break; \ + case CMM_ANNOTATE_LOAD: \ + break; \ + case CMM_ANNOTATE_STORE: \ + cmm_annotate_die("store for acquire group"); \ + break; \ + case CMM_ANNOTATE_MB: \ + cmm_annotate_die( \ + "redundant mb for acquire group" \ + ); \ + break; \ + } \ + *(group) = CMM_ANNOTATE_MB; \ + } while (0) + +# define cmm_annotate_group_mb_release(group) \ + do { \ + switch (cmm_annotate_dereference(group)) { \ + case CMM_ANNOTATE_VOID: \ + break; \ + case CMM_ANNOTATE_LOAD: \ + cmm_annotate_die("load before release group"); \ + break; \ + case CMM_ANNOTATE_STORE: \ + cmm_annotate_die( \ + "store before release group" \ + ); \ + break; \ + case CMM_ANNOTATE_MB: \ + cmm_annotate_die( \ + "redundant mb of release group" \ + ); \ + break; \ + } \ + *(group) = CMM_ANNOTATE_MB; \ + } while (0) + +# define cmm_annotate_group_mem_acquire(group, mem) \ + do { \ + __tsan_acquire((void*)(mem)); \ + switch (cmm_annotate_dereference(group)) { \ + case CMM_ANNOTATE_VOID: \ + *(group) = CMM_ANNOTATE_LOAD; \ + break; \ + case CMM_ANNOTATE_MB: \ + cmm_annotate_die( \ + "load after mb for acquire group" \ + ); \ + break; \ + default: \ + break; \ + } \ + } while (0) + +# define cmm_annotate_group_mem_release(group, mem) \ + do { \ + __tsan_release((void*)(mem)); \ + switch (cmm_annotate_dereference(group)) { \ + case CMM_ANNOTATE_MB: \ + break; \ + default: \ + cmm_annotate_die( \ + "missing mb for release group" \ + ); \ + } \ + } while (0) + +# define cmm_annotate_mem_acquire(mem) \ + __tsan_acquire((void*)(mem)) + +# define cmm_annotate_mem_release(mem) \ + __tsan_release((void*)(mem)) +#else + +# define cmm_annotate_group_mb_acquire(group) \ + (void) (group) + +# define cmm_annotate_group_mb_release(group) \ + (void) (group) + +# define cmm_annotate_group_mem_acquire(group, mem) \ + (void) (group) + +# define cmm_annotate_group_mem_release(group, mem) \ + (void) (group) + +# define cmm_annotate_mem_acquire(mem) \ + do { } while (0) + +# define cmm_annotate_mem_release(mem) \ + do { } while (0) + +#endif /* CMM_SANITIZE_THREAD */ + +#endif /* _URCU_ANNOTATE_H */ diff --git a/include/urcu/arch.h b/include/urcu/arch.h index 620743c..5147d30 100644 --- a/include/urcu/arch.h +++ b/include/urcu/arch.h @@ -1,22 +1,6 @@ -/* - * urcu/arch.h - * - * Copyright (c) 2020 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2020 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later #ifndef _URCU_ARCH_H #define _URCU_ARCH_H @@ -49,6 +33,7 @@ * URCU_ARCH_HPPA : All HP PA-RISC variants * URCU_ARCH_M68K : All Motorola 68000 variants * URCU_ARCH_RISCV : All RISC-V variants + * URCU_ARCH_LOONGARCH : All LoongArch variants */ #if (defined(__INTEL_OFFLOAD) || defined(__TARGET_ARCH_MIC) || defined(__MIC__)) @@ -64,15 +49,25 @@ #define URCU_ARCH_AMD64 1 #include -#elif (defined(__i486__) || defined(__i586__) || defined(__i686__)) - -#define URCU_ARCH_X86 1 -#include - #elif (defined(__i386__) || defined(__i386)) #define URCU_ARCH_X86 1 + +/* + * URCU_ARCH_X86_NO_CAS enables a compat layer that will detect the presence of + * the cmpxchg instructions at runtime and provide a compat mode based on a + * pthread mutex when it isn't. + * + * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 was introduced in GCC 4.3 and Clang 3.3, + * building with older compilers will result in the compat layer always being + * used on x86-32. + */ +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define URCU_ARCH_X86_NO_CAS 1 +/* For backwards compat */ #define URCU_ARCH_I386 1 +#endif + #include #elif (defined(__powerpc64__) || defined(__ppc64__)) @@ -157,9 +152,20 @@ #define URCU_ARCH_RISCV 1 #include +#elif defined(__loongarch__) + +#define URCU_ARCH_LOONGARCH 1 +#include + #else #error "Cannot build: unrecognized architecture, see ." #endif +#ifdef CONFIG_RCU_EMIT_LEGACY_MB +# define cmm_emit_legacy_smp_mb() cmm_smp_mb() +#else +# define cmm_emit_legacy_smp_mb() do { } while (0) +#endif + #endif /* _URCU_ARCH_H */ diff --git a/include/urcu/arch/aarch64.h b/include/urcu/arch/aarch64.h index 9e2f1ff..f573306 100644 --- a/include/urcu/arch/aarch64.h +++ b/include/urcu/arch/aarch64.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_AARCH64_H #define _URCU_ARCH_AARCH64_H /* * arch/aarch64.h: definitions for aarch64 architecture - * - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -44,13 +32,23 @@ extern "C" { /* * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 + * + * Backported in RHEL7 gcc 4.8.5-11 */ +#if defined(URCU_GCC_VERSION) && defined(__GNUC_RH_RELEASE__) +# if (URCU_GCC_VERSION == 40805) && (__GNUC_RH_RELEASE__ >= 11) +# define URCU_GCC_PATCHED_63293 +# endif +#endif + #ifdef URCU_GCC_VERSION -# if URCU_GCC_VERSION < 50100 +# if URCU_GCC_VERSION < 50100 && !defined(URCU_GCC_PATCHED_63293) # error Your gcc version performs unsafe access to deallocated stack # endif #endif +#define caa_cpu_relax() __asm__ __volatile__ ("yield" : : : "memory") + #ifdef __cplusplus } #endif diff --git a/include/urcu/arch/alpha.h b/include/urcu/arch/alpha.h index e61f82c..db7ab3e 100644 --- a/include/urcu/arch/alpha.h +++ b/include/urcu/arch/alpha.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_ALPHA_H #define _URCU_ARCH_ALPHA_H /* * arch_alpha.h: trivial definitions for the Alpha architecture. - * - * Copyright (c) 2010 Paolo Bonzini - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -33,6 +21,14 @@ extern "C" { #define cmm_wmb() __asm__ __volatile__ ("wmb":::"memory") #define cmm_read_barrier_depends() __asm__ __volatile__ ("mb":::"memory") +/* + * On Linux, define the membarrier system call number if not yet available in + * the system headers. + */ +#if (defined(__linux__) && !defined(__NR_membarrier)) +#define __NR_membarrier 517 +#endif + #ifdef __cplusplus } #endif diff --git a/include/urcu/arch/arm.h b/include/urcu/arch/arm.h index 54ca4fa..407f422 100644 --- a/include/urcu/arch/arm.h +++ b/include/urcu/arch/arm.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_ARM_H #define _URCU_ARCH_ARM_H /* * arch_arm.h: trivial definitions for the ARM architecture. - * - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/gcc.h b/include/urcu/arch/gcc.h index e5700e4..1987450 100644 --- a/include/urcu/arch/gcc.h +++ b/include/urcu/arch/gcc.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_GCC_H #define _URCU_ARCH_GCC_H /* * arch_gcc.h: trivial definitions for architectures using gcc __sync_ - * - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/generic.h b/include/urcu/arch/generic.h index be6e41e..ac15a3b 100644 --- a/include/urcu/arch/generic.h +++ b/include/urcu/arch/generic.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_GENERIC_H #define _URCU_ARCH_GENERIC_H /* * arch_generic.h: common definitions for multiple architectures. - * - * Copyright (c) 2010 Paolo Bonzini - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -43,6 +31,57 @@ extern "C" { * GCC builtins) as well as cmm_rmb and cmm_wmb (defaulting to cmm_mb). */ +#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS + +# ifdef CMM_SANITIZE_THREAD +/* + * This makes TSAN quiet about unsupported thread fence. + */ +static inline void _cmm_thread_fence_wrapper(void) +{ +# if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpragmas" +# pragma clang diagnostic ignored "-Wunknown-warning-option" +# pragma clang diagnostic ignored "-Wtsan" +# elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpragmas" +# pragma GCC diagnostic ignored "-Wtsan" +# endif + __atomic_thread_fence(__ATOMIC_SEQ_CST); +# if defined(__clang__) +# pragma clang diagnostic pop +# elif defined(__GNUC__) +# pragma GCC diagnostic pop +# endif +} +# endif /* CMM_SANITIZE_THREAD */ + +# ifndef cmm_smp_mb +# ifdef CMM_SANITIZE_THREAD +# define cmm_smp_mb() _cmm_thread_fence_wrapper() +# else +# define cmm_smp_mb() __atomic_thread_fence(__ATOMIC_SEQ_CST) +# endif /* CMM_SANITIZE_THREAD */ +# endif /* !cmm_smp_mb */ + +#endif /* CONFIG_RCU_USE_ATOMIC_BUILTINS */ + + +/* + * cmm_mb() expands to __sync_synchronize() instead of __atomic_thread_fence + * with SEQ_CST because the former "issues a full memory barrier" while the + * latter "acts as a synchronization fence between threads" which is too weak + * for what we want, for example with I/O devices. + * + * Even though sync_synchronize seems to be an alias for a sequential consistent + * atomic thread fence on every architecture on GCC and Clang, this assumption + * might be untrue in future. Therefore, the definitions above are used to + * ensure correct behavior in the future. + * + * The above defintions are quoted from the GCC manual. + */ #ifndef cmm_mb #define cmm_mb() __sync_synchronize() #endif diff --git a/include/urcu/arch/hppa.h b/include/urcu/arch/hppa.h index c8d4d05..2a2236e 100644 --- a/include/urcu/arch/hppa.h +++ b/include/urcu/arch/hppa.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2014 Helge Deller +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_HPPA_H #define _URCU_ARCH_HPPA_H /* * arch/hppa.h: definitions for hppa architecture - * - * Copyright (c) 2014 Helge Deller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/ia64.h b/include/urcu/arch/ia64.h index bca007c..9ed0096 100644 --- a/include/urcu/arch/ia64.h +++ b/include/urcu/arch/ia64.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_IA64_H #define _URCU_ARCH_IA64_H /* * arch/ia64.h: definitions for ia64 architecture - * - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/loongarch.h b/include/urcu/arch/loongarch.h new file mode 100644 index 0000000..7e82d9a --- /dev/null +++ b/include/urcu/arch/loongarch.h @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2021 Wang Jing +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef _URCU_ARCH_LOONGARCH_H +#define _URCU_ARCH_LOONGARCH_H + +/* + * arch/loongarch.h: trivial definitions for the LoongArch architecture. + */ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* + * On Linux, define the membarrier system call number if not yet available in + * the system headers. + */ +#if (defined(__linux__) && !defined(__NR_membarrier)) +#define __NR_membarrier 283 +#endif + +#ifdef __cplusplus +} +#endif + +#include + +#endif /* _URCU_ARCH_LOONGARCH_H */ diff --git a/include/urcu/arch/m68k.h b/include/urcu/arch/m68k.h index f7698c3..29dbfc5 100644 --- a/include/urcu/arch/m68k.h +++ b/include/urcu/arch/m68k.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2017 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_M68K_H #define _URCU_ARCH_M68K_H /* * arch/m68k.h: definitions for m68k architecture - * - * Copyright (c) 2017 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/mips.h b/include/urcu/arch/mips.h index ea5b7e9..c22dee2 100644 --- a/include/urcu/arch/mips.h +++ b/include/urcu/arch/mips.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// SPDX-FileCopyrightText: 2012 Ralf Baechle +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_MIPS_H #define _URCU_ARCH_MIPS_H /* * arch_mips.h: trivial definitions for the MIPS architecture. - * - * Copyright (c) 2010 Paolo Bonzini - * Copyright (c) 2012 Ralf Baechle - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/nios2.h b/include/urcu/arch/nios2.h index b4f3e50..4887443 100644 --- a/include/urcu/arch/nios2.h +++ b/include/urcu/arch/nios2.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2016 Marek Vasut +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_NIOS2_H #define _URCU_ARCH_NIOS2_H /* * arch_nios2.h: trivial definitions for the NIOS2 architecture. - * - * Copyright (c) 2016 Marek Vasut - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/ppc.h b/include/urcu/arch/ppc.h index 791529e..1285b6d 100644 --- a/include/urcu/arch/ppc.h +++ b/include/urcu/arch/ppc.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_PPC_H #define _URCU_ARCH_PPC_H /* * arch_ppc.h: trivial definitions for the powerpc architecture. - * - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -31,7 +19,30 @@ extern "C" { #endif -/* Include size of POWER5+ L3 cache lines: 256 bytes */ +/* + * Most powerpc machines have 128 bytes cache lines, but to make sure + * there is no false sharing on all known Power hardware, use the + * largest known cache line size, which is the physical size of POWER5 + * L3 cache lines (256 bytes). + * + * "Each slice [of the L3] is 12-way set-associative, with 4,096 + * congruence classes of 256-byte lines managed as two 128-byte sectors + * to match the L2 line size." + * + * From: "POWER5 system microarchitecture", + * IBM Journal of Research & Development, + * vol. 49, no. 4/5, July/September 2005 + * https://www.eecg.utoronto.ca/~moshovos/ACA08/readings/power5.pdf + * + * This value is a compile-time constant, which prevents us from + * querying the processor for the cache line size at runtime. We + * therefore need to be pessimistic and assume the largest known cache + * line size. + * + * This value is exposed through public headers, so tuning it for + * specific environments is a concern for ABI compatibility between + * applications and liburcu. + */ #define CAA_CACHE_LINE_SIZE 256 #ifdef __NO_LWSYNC__ @@ -63,7 +74,7 @@ extern "C" { __extension__ \ ({ \ unsigned long rval; \ - __asm__ __volatile__ ("mftbl %0" : "=r" (rval)); \ + __asm__ __volatile__ ("mftb %0" : "=r" (rval)); \ rval; \ }) diff --git a/include/urcu/arch/riscv.h b/include/urcu/arch/riscv.h index 1fd7d62..cb8173f 100644 --- a/include/urcu/arch/riscv.h +++ b/include/urcu/arch/riscv.h @@ -1,24 +1,12 @@ +// SPDX-FileCopyrightText: 2018 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_RISCV_H #define _URCU_ARCH_RISCV_H /* * arch/riscv.h: definitions for the RISC-V architecture - * - * Copyright (c) 2018 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/s390.h b/include/urcu/arch/s390.h index 67461b4..906d3e9 100644 --- a/include/urcu/arch/s390.h +++ b/include/urcu/arch/s390.h @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2009 Novell, Inc. +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_ARCH_S390_H #define _URCU_ARCH_S390_H @@ -6,26 +10,7 @@ * Principles of Operation "CPU Serialization" (5-91), "BRANCH ON CONDITION" * (7-25) and "STORE CLOCK" (7-169). * - * Copyright (c) 2009 Novell, Inc. * Author: Jan Blunck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #include diff --git a/include/urcu/arch/sparc64.h b/include/urcu/arch/sparc64.h index 1ff40f5..1fdc6a4 100644 --- a/include/urcu/arch/sparc64.h +++ b/include/urcu/arch/sparc64.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_SPARC64_H #define _URCU_ARCH_SPARC64_H /* * arch_sparc64.h: trivial definitions for the Sparc64 architecture. - * - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/tile.h b/include/urcu/arch/tile.h index eae1161..0c5af19 100644 --- a/include/urcu/arch/tile.h +++ b/include/urcu/arch/tile.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_TILE_H #define _URCU_ARCH_TILE_H /* * arch/tile.h: definitions for tile architecture - * - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/arch/x86.h b/include/urcu/arch/x86.h index 744f9f9..dcff3a8 100644 --- a/include/urcu/arch/x86.h +++ b/include/urcu/arch/x86.h @@ -1,25 +1,13 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_X86_H #define _URCU_ARCH_X86_H /* * arch_x86.h: trivial definitions for the x86 architecture. - * - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/assert.h b/include/urcu/assert.h index c22419f..3b8cdc6 100644 --- a/include/urcu/assert.h +++ b/include/urcu/assert.h @@ -1,22 +1,12 @@ +// SPDX-FileCopyrightText: 2021 Francis Deslauriers +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_ASSERT_H #define _URCU_ASSERT_H /* - * urcu/assert.h - * * Userspace RCU assertion facilities. - * - * Copyright (c) 2021 Francis Deslauriers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. */ #include diff --git a/include/urcu/call-rcu.h b/include/urcu/call-rcu.h index fc63ecd..6b6de5c 100644 --- a/include/urcu/call-rcu.h +++ b/include/urcu/call-rcu.h @@ -1,30 +1,16 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_CALL_RCU_H #define _URCU_CALL_RCU_H /* - * urcu/call-rcu.h - * * Userspace RCU header - batch memory reclamation with kernel API * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * This header is meant to be included indirectly through a liburcu * flavor header. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/cds.h b/include/urcu/cds.h index 78534bb..9eae429 100644 --- a/include/urcu/cds.h +++ b/include/urcu/cds.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_CDS_H #define _URCU_CDS_H /* - * urcu/cds.h - * * Userspace RCU library - Concurrent Data Structures - * - * Copyright 2011 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/compiler.h b/include/urcu/compiler.h index 34eb564..197656c 100644 --- a/include/urcu/compiler.h +++ b/include/urcu/compiler.h @@ -1,30 +1,30 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_COMPILER_H #define _URCU_COMPILER_H /* - * compiler.h - * * Compiler definitions. - * - * Copyright (c) 2009 Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. */ #include /* for offsetof */ +#if defined __cplusplus +# include /* for std::remove_cv */ +#endif + +#include + #define caa_likely(x) __builtin_expect(!!(x), 1) #define caa_unlikely(x) __builtin_expect(!!(x), 0) -#define cmm_barrier() __asm__ __volatile__ ("" : : : "memory") +#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS +# define cmm_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST) +#else +# define cmm_barrier() __asm__ __volatile__ ("" : : : "memory") +#endif /* * Instruct the compiler to perform only a single access to a variable @@ -70,6 +70,23 @@ (type *)((char *)__ptr - offsetof(type, member)); \ }) +/* + * caa_container_of_check_null - Get the address of an object containing a field. + * + * @ptr: pointer to the field. + * @type: type of the object. + * @member: name of the field within the object. + * + * Return the address of the object containing the field. Return NULL if + * @ptr is NULL. + */ +#define caa_container_of_check_null(ptr, type, member) \ + __extension__ \ + ({ \ + const __typeof__(((type *) NULL)->member) * __ptr = (ptr); \ + (__ptr) ? (type *)((char *)__ptr - offsetof(type, member)) : NULL; \ + }) + #define CAA_BUILD_BUG_ON_ZERO(cond) (sizeof(struct { int:-!!(cond); })) #define CAA_BUILD_BUG_ON(cond) ((void)CAA_BUILD_BUG_ON_ZERO(cond)) @@ -82,7 +99,7 @@ #define __rcu #ifdef __cplusplus -#define URCU_FORCE_CAST(type, arg) (reinterpret_cast(arg)) +#define URCU_FORCE_CAST(_type, arg) (reinterpret_cast::type>(arg)) #else #define URCU_FORCE_CAST(type, arg) ((type) (arg)) #endif @@ -119,4 +136,93 @@ + __GNUC_PATCHLEVEL__) #endif +#ifdef __cplusplus +#define caa_unqual_scalar_typeof(x) \ + std::remove_cv::type>::type +#else +#define caa_scalar_type_to_expr(type) \ + unsigned type: (unsigned type)0, \ + signed type: (signed type)0 + +/* + * Use C11 _Generic to express unqualified type from expression. This removes + * volatile qualifier from expression type. + */ +#define caa_unqual_scalar_typeof(x) \ + __typeof__( \ + _Generic((x), \ + char: (char)0, \ + caa_scalar_type_to_expr(char), \ + caa_scalar_type_to_expr(short), \ + caa_scalar_type_to_expr(int), \ + caa_scalar_type_to_expr(long), \ + caa_scalar_type_to_expr(long long), \ + default: (x) \ + ) \ + ) +#endif + +/* + * Allow user to manually define CMM_SANITIZE_THREAD if their toolchain is not + * supported by this check. + */ +#ifndef CMM_SANITIZE_THREAD +# if defined(__GNUC__) && defined(__SANITIZE_THREAD__) +# define CMM_SANITIZE_THREAD +# elif defined(__clang__) && defined(__has_feature) +# if __has_feature(thread_sanitizer) +# define CMM_SANITIZE_THREAD +# endif +# endif +#endif /* !CMM_SANITIZE_THREAD */ + +/* + * Helper to add the volatile qualifier to a pointer. + */ +#if defined __cplusplus +template +volatile T cmm_cast_volatile(T t) +{ + return static_cast(t); +} +#else +# define cmm_cast_volatile(ptr) \ + __extension__ \ + ({ \ + (volatile __typeof__(ptr))(ptr); \ + }) +#endif + +/* + * Compile time assertion. + * - predicate: boolean expression to evaluate, + * - msg: string to print to the user on failure when `static_assert()` is + * supported, + * - c_identifier_msg: message to be included in the typedef to emulate a + * static assertion. This parameter must be a valid C identifier as it will + * be used as a typedef name. + */ +#ifdef __cplusplus +#define urcu_static_assert(predicate, msg, c_identifier_msg) \ + static_assert(predicate, msg) +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +#define urcu_static_assert(predicate, msg, c_identifier_msg) \ + _Static_assert(predicate, msg) +#else +/* + * Evaluates the predicate and emit a compilation error on failure. + * + * If the predicate evaluates to true, this macro emits a function + * prototype with an argument type which is an array of size 0. + * + * If the predicate evaluates to false, this macro emits a function + * prototype with an argument type which is an array of negative size + * which is invalid in C and forces a compiler error. The + * c_identifier_msg parameter is used as the argument identifier so it + * is printed to the user when the error is reported. + */ +#define urcu_static_assert(predicate, msg, c_identifier_msg) \ + void urcu_static_assert_proto(char c_identifier_msg[2*!!(predicate)-1]) +#endif + #endif /* _URCU_COMPILER_H */ diff --git a/include/urcu/config.h.in b/include/urcu/config.h.in index 99d763a..473d7a2 100644 --- a/include/urcu/config.h.in +++ b/include/urcu/config.h.in @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* urcu/config.h.in. Manually generated for control over the contained defs. */ /* Enable SMP support. With SMP support enabled, uniprocessors are also @@ -19,6 +23,12 @@ Introduces a performance penalty. */ #undef CONFIG_RCU_DEBUG +/* Uatomic API uses atomic builtins. */ +#undef CONFIG_RCU_USE_ATOMIC_BUILTINS + +/* Emit legacy memory barriers? */ +#undef CONFIG_RCU_EMIT_LEGACY_MB + /* Expose multi-flavor support */ #define CONFIG_RCU_HAVE_MULTIFLAVOR 1 diff --git a/include/urcu/debug.h b/include/urcu/debug.h index 41727f3..ff89de2 100644 --- a/include/urcu/debug.h +++ b/include/urcu/debug.h @@ -1,22 +1,12 @@ +// SPDX-FileCopyrightText: 2015 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_DEBUG_H #define _URCU_DEBUG_H /* - * urcu/debug.h - * * Userspace RCU debugging facilities. - * - * Copyright (c) 2015 Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. */ #include diff --git a/include/urcu/defer.h b/include/urcu/defer.h index 67b5f80..db36404 100644 --- a/include/urcu/defer.h +++ b/include/urcu/defer.h @@ -1,30 +1,16 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_DEFER_H #define _URCU_DEFER_H /* - * urcu/defer.h - * * Userspace RCU header - deferred execution * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * This header is meant to be included indirectly through a liburcu * flavor header. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/flavor.h b/include/urcu/flavor.h index 1a92089..ce2a013 100644 --- a/include/urcu/flavor.h +++ b/include/urcu/flavor.h @@ -1,28 +1,16 @@ +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_FLAVOR_H #define _URCU_FLAVOR_H /* - * urcu-flavor.h - * * Userspace RCU header - rcu flavor declarations - * - * Copyright (c) 2011 Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -58,6 +46,9 @@ struct rcu_flavor_struct { void (*register_rculfhash_atfork)(struct urcu_atfork *atfork); void (*unregister_rculfhash_atfork)(struct urcu_atfork *atfork); + + struct urcu_gp_poll_state (*update_start_poll_synchronize_rcu)(void); + bool (*update_poll_state_synchronize_rcu)(struct urcu_gp_poll_state state); }; #define DEFINE_RCU_FLAVOR(x) \ @@ -76,6 +67,8 @@ const struct rcu_flavor_struct x = { \ .barrier = rcu_barrier, \ .register_rculfhash_atfork = urcu_register_rculfhash_atfork, \ .unregister_rculfhash_atfork = urcu_unregister_rculfhash_atfork,\ + .update_start_poll_synchronize_rcu = start_poll_synchronize_rcu,\ + .update_poll_state_synchronize_rcu = poll_state_synchronize_rcu,\ } extern const struct rcu_flavor_struct rcu_flavor; diff --git a/include/urcu/futex.h b/include/urcu/futex.h index 753cf16..9d0a997 100644 --- a/include/urcu/futex.h +++ b/include/urcu/futex.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2011-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_FUTEX_H #define _URCU_FUTEX_H /* - * urcu-futex.h - * * Userspace RCU - sys_futex/compat_futex header. - * - * Copyright 2011-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -30,6 +16,23 @@ #include #include +#if (defined(__linux__) && defined(__NR_futex)) + +/* For backwards compat */ +#define CONFIG_RCU_HAVE_FUTEX 1 + +#include +#include +#include +#include + +#elif defined(__FreeBSD__) + +#include +#include + +#endif + #ifdef __cplusplus extern "C" { #endif @@ -58,14 +61,6 @@ extern int compat_futex_async(int32_t *uaddr, int op, int32_t val, #if (defined(__linux__) && defined(__NR_futex)) -/* For backwards compat */ -#define CONFIG_RCU_HAVE_FUTEX 1 - -#include -#include -#include -#include - static inline int futex(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout, int32_t *uaddr2, int32_t val3) { @@ -111,9 +106,6 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val, #elif defined(__FreeBSD__) -#include -#include - static inline int futex_async(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout, int32_t *uaddr2 __attribute__((unused)), diff --git a/include/urcu/hlist.h b/include/urcu/hlist.h index c5ebbbe..9a1eb21 100644 --- a/include/urcu/hlist.h +++ b/include/urcu/hlist.h @@ -1,3 +1,8 @@ +// SPDX-FileCopyrightText: 2009 Novell Inc. +// SPDX-FileCopyrightText: 2010-2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-only + #ifndef _KCOMPAT_HLIST_H #define _KCOMPAT_HLIST_H @@ -5,15 +10,7 @@ * Kernel sourcecode compatible lightweight single pointer list head useful * for implementing hash tables * - * Copyright (C) 2009 Novell Inc. - * * Author: Jan Blunck - * - * Copyright (C) 2010-2013 Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. */ #include diff --git a/include/urcu/lfstack.h b/include/urcu/lfstack.h index 0f4ee99..77af43b 100644 --- a/include/urcu/lfstack.h +++ b/include/urcu/lfstack.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_LFSTACK_H #define _URCU_LFSTACK_H /* - * lfstack.h - * * Userspace RCU library - Lock-Free Stack - * - * Copyright 2010-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef __cplusplus diff --git a/include/urcu/list.h b/include/urcu/list.h index 8cfbd84..4bc88b3 100644 --- a/include/urcu/list.h +++ b/include/urcu/list.h @@ -1,25 +1,12 @@ +// SPDX-FileCopyrightText: 2002 Free Software Foundation, Inc. +// SPDX-FileCopyrightText: 2009 Pierre-Marc Fournier +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * Copyright (C) 2002 Free Software Foundation, Inc. * (originally part of the GNU C Library) * Contributed by Ulrich Drepper , 2002. - * - * Copyright (C) 2009 Pierre-Marc Fournier - * Conversion to RCU list. - * Copyright (C) 2010 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _CDS_LIST_H diff --git a/include/urcu/map/clear.h b/include/urcu/map/clear.h index 8aff778..9ab1219 100644 --- a/include/urcu/map/clear.h +++ b/include/urcu/map/clear.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * map/urcu-clear.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #undef _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -76,3 +62,6 @@ #undef urcu_register_rculfhash_atfork #undef urcu_unregister_rculfhash_atfork + +#undef start_poll_synchronize_rcu +#undef poll_state_synchronize_rcu diff --git a/include/urcu/map/urcu-bp.h b/include/urcu/map/urcu-bp.h index 6f0a15a..da7a5eb 100644 --- a/include/urcu/map/urcu-bp.h +++ b/include/urcu/map/urcu-bp.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu/map/urcu-bp.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -83,6 +69,9 @@ #define urcu_unregister_rculfhash_atfork \ urcu_bp_unregister_rculfhash_atfork +#define start_poll_synchronize_rcu urcu_bp_start_poll_synchronize_rcu +#define poll_state_synchronize_rcu urcu_bp_poll_state_synchronize_rcu + /* Compat identifiers for prior undocumented multiflavor usage */ #ifndef URCU_NO_COMPAT_IDENTIFIERS diff --git a/include/urcu/map/urcu-mb.h b/include/urcu/map/urcu-mb.h index d3e9513..1f1147f 100644 --- a/include/urcu/map/urcu-mb.h +++ b/include/urcu/map/urcu-mb.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu/map/urcu-mb.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -78,6 +64,9 @@ #define urcu_unregister_rculfhash_atfork \ urcu_mb_unregister_rculfhash_atfork +#define start_poll_synchronize_rcu urcu_mb_start_poll_synchronize_rcu +#define poll_state_synchronize_rcu urcu_mb_poll_state_synchronize_rcu + /* Compat identifiers for prior undocumented multiflavor usage */ #ifndef URCU_NO_COMPAT_IDENTIFIERS diff --git a/include/urcu/map/urcu-memb.h b/include/urcu/map/urcu-memb.h index 1e9740f..9ae4279 100644 --- a/include/urcu/map/urcu-memb.h +++ b/include/urcu/map/urcu-memb.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu/map/urcu-memb.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -78,6 +64,9 @@ #define urcu_unregister_rculfhash_atfork \ urcu_memb_unregister_rculfhash_atfork +#define start_poll_synchronize_rcu urcu_memb_start_poll_synchronize_rcu +#define poll_state_synchronize_rcu urcu_memb_poll_state_synchronize_rcu + /* Compat identifiers for prior undocumented multiflavor usage */ #ifndef URCU_NO_COMPAT_IDENTIFIERS diff --git a/include/urcu/map/urcu-qsbr.h b/include/urcu/map/urcu-qsbr.h index ce4d50b..d177fc5 100644 --- a/include/urcu/map/urcu-qsbr.h +++ b/include/urcu/map/urcu-qsbr.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu/map/urcu-qsbr.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -77,6 +63,10 @@ #define urcu_unregister_rculfhash_atfork \ urcu_qsbr_unregister_rculfhash_atfork +#define start_poll_synchronize_rcu urcu_qsbr_start_poll_synchronize_rcu +#define poll_state_synchronize_rcu urcu_qsbr_poll_state_synchronize_rcu + + /* Compat identifiers for prior undocumented multiflavor usage */ #ifndef URCU_NO_COMPAT_IDENTIFIERS diff --git a/include/urcu/map/urcu-signal.h b/include/urcu/map/urcu-signal.h deleted file mode 100644 index 29ccaad..0000000 --- a/include/urcu/map/urcu-signal.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * urcu/map/urcu-signal.h - * - * Userspace RCU header -- name mapping to allow multiple flavors to be - * used in the same executable. - * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * LGPL-compatible code should include this header with : - * - * #define _LGPL_SOURCE - * #include - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * IBM's contributions to this file may be relicensed under LGPLv2 or later. - */ - -#define rcu_read_lock urcu_signal_read_lock -#define _rcu_read_lock _urcu_signal_read_lock -#define rcu_read_unlock urcu_signal_read_unlock -#define _rcu_read_unlock _urcu_signal_read_unlock -#define rcu_read_ongoing urcu_signal_read_ongoing -#define _rcu_read_ongoing _urcu_signal_read_ongoing -#define rcu_quiescent_state urcu_signal_quiescent_state -#define _rcu_quiescent_state _urcu_signal_quiescent_state -#define rcu_thread_offline urcu_signal_thread_offline -#define rcu_thread_online urcu_signal_thread_online -#define rcu_register_thread urcu_signal_register_thread -#define rcu_unregister_thread urcu_signal_unregister_thread -#define rcu_init urcu_signal_init -#define rcu_exit urcu_signal_exit -#define synchronize_rcu urcu_signal_synchronize_rcu -#define rcu_reader urcu_signal_reader -#define rcu_gp urcu_signal_gp - -#define get_cpu_call_rcu_data urcu_signal_get_cpu_call_rcu_data -#define get_call_rcu_thread urcu_signal_get_call_rcu_thread -#define create_call_rcu_data urcu_signal_create_call_rcu_data -#define set_cpu_call_rcu_data urcu_signal_set_cpu_call_rcu_data -#define get_default_call_rcu_data urcu_signal_get_default_call_rcu_data -#define get_call_rcu_data urcu_signal_get_call_rcu_data -#define get_thread_call_rcu_data urcu_signal_get_thread_call_rcu_data -#define set_thread_call_rcu_data urcu_signal_set_thread_call_rcu_data -#define create_all_cpu_call_rcu_data urcu_signal_create_all_cpu_call_rcu_data -#define free_all_cpu_call_rcu_data urcu_signal_free_all_cpu_call_rcu_data -#define call_rcu urcu_signal_call_rcu -#define call_rcu_data_free urcu_signal_call_rcu_data_free -#define call_rcu_before_fork urcu_signal_call_rcu_before_fork -#define call_rcu_after_fork_parent urcu_signal_call_rcu_after_fork_parent -#define call_rcu_after_fork_child urcu_signal_call_rcu_after_fork_child -#define rcu_barrier urcu_signal_barrier - -#define defer_rcu urcu_signal_defer_rcu -#define rcu_defer_register_thread urcu_signal_defer_register_thread -#define rcu_defer_unregister_thread urcu_signal_defer_unregister_thread -#define rcu_defer_barrier urcu_signal_defer_barrier -#define rcu_defer_barrier_thread urcu_signal_defer_barrier_thread -#define rcu_defer_exit urcu_signal_defer_exit - -#define rcu_flavor urcu_signal_flavor - -#define urcu_register_rculfhash_atfork \ - urcu_signal_register_rculfhash_atfork -#define urcu_unregister_rculfhash_atfork \ - urcu_signal_unregister_rculfhash_atfork - - -/* Compat identifiers for prior undocumented multiflavor usage */ -#ifndef URCU_NO_COMPAT_IDENTIFIERS - -#define rcu_dereference_sig urcu_signal_dereference -#define rcu_cmpxchg_pointer_sig urcu_signal_cmpxchg_pointer -#define rcu_xchg_pointer_sig urcu_signal_xchg_pointer -#define rcu_set_pointer_sig urcu_signal_set_pointer - -#define rcu_sig_before_fork urcu_signal_before_fork -#define rcu_sig_after_fork_parent urcu_signal_after_fork_parent -#define rcu_sig_after_fork_child urcu_signal_after_fork_child - -#define rcu_read_lock_sig urcu_signal_read_lock -#define _rcu_read_lock_sig _urcu_signal_read_lock -#define rcu_read_unlock_sig urcu_signal_read_unlock -#define _rcu_read_unlock_sig _urcu_signal_read_unlock -#define rcu_read_ongoing_sig urcu_signal_read_ongoing -#define _rcu_read_ongoing_sig _urcu_signal_read_ongoing -#define rcu_register_thread_sig urcu_signal_register_thread -#define rcu_unregister_thread_sig urcu_signal_unregister_thread -#define rcu_init_sig urcu_signal_init -#define rcu_exit_sig urcu_signal_exit -#define synchronize_rcu_sig urcu_signal_synchronize_rcu -#define rcu_reader_sig urcu_signal_reader -#define rcu_gp_sig urcu_signal_gp - -#define get_cpu_call_rcu_data_sig urcu_signal_get_cpu_call_rcu_data -#define get_call_rcu_thread_sig urcu_signal_get_call_rcu_thread -#define create_call_rcu_data_sig urcu_signal_create_call_rcu_data -#define set_cpu_call_rcu_data_sig urcu_signal_set_cpu_call_rcu_data -#define get_default_call_rcu_data_sig urcu_signal_get_default_call_rcu_data -#define get_call_rcu_data_sig urcu_signal_get_call_rcu_data -#define get_thread_call_rcu_data_sig urcu_signal_get_thread_call_rcu_data -#define set_thread_call_rcu_data_sig urcu_signal_set_thread_call_rcu_data -#define create_all_cpu_call_rcu_data_sig \ - urcu_signal_create_all_cpu_call_rcu_data -#define free_all_cpu_call_rcu_data_sig urcu_signal_free_all_cpu_call_rcu_data -#define call_rcu_sig urcu_signal_call_rcu -#define call_rcu_data_free_sig urcu_signal_call_rcu_data_free -#define call_rcu_before_fork_sig \ - urcu_signal_call_rcu_before_fork -#define call_rcu_after_fork_parent_sig urcu_signal_call_rcu_after_fork_parent -#define call_rcu_after_fork_child_sig urcu_signal_call_rcu_after_fork_child -#define rcu_barrier_sig urcu_signal_barrier - -#define defer_rcu_sig urcu_signal_defer_rcu -#define rcu_defer_register_thread_sig urcu_signal_defer_register_thread -#define rcu_defer_unregister_thread_sig urcu_signal_defer_unregister_thread -#define rcu_defer_barrier_sig urcu_signal_defer_barrier -#define rcu_defer_barrier_thread_sig urcu_signal_defer_barrier_thread -#define rcu_defer_exit_sig urcu_signal_defer_exit - -#define rcu_flavor_sig urcu_signal_flavor - -#define urcu_register_rculfhash_atfork_sig \ - urcu_signal_register_rculfhash_atfork -#define urcu_unregister_rculfhash_atfork_sig \ - urcu_signal_unregister_rculfhash_atfork - -#endif /* URCU_NO_COMPAT_IDENTIFIERS */ diff --git a/include/urcu/map/urcu.h b/include/urcu/map/urcu.h index a2fb7c8..96c5347 100644 --- a/include/urcu/map/urcu.h +++ b/include/urcu/map/urcu.h @@ -1,38 +1,22 @@ +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu-map.h - * * Userspace RCU header -- name mapping to allow multiple flavors to be * used in the same executable. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ #ifdef RCU_MEMBARRIER #include -#elif defined(RCU_SIGNAL) -#include #elif defined(RCU_MB) #include #else diff --git a/include/urcu/pointer.h b/include/urcu/pointer.h index a670272..cc9aeae 100644 --- a/include/urcu/pointer.h +++ b/include/urcu/pointer.h @@ -1,28 +1,14 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_POINTER_H #define _URCU_POINTER_H /* - * urcu/pointer.h - * * Userspace RCU header. Operations on pointers. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ diff --git a/include/urcu/rcuhlist.h b/include/urcu/rcuhlist.h index 20c7238..6dab12a 100644 --- a/include/urcu/rcuhlist.h +++ b/include/urcu/rcuhlist.h @@ -1,25 +1,12 @@ +// SPDX-FileCopyrightText: 2002 Free Software Foundation, Inc. +// SPDX-FileCopyrightText: 2009 Pierre-Marc Fournier +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * Copyright (C) 2002 Free Software Foundation, Inc. * (originally part of the GNU C Library) * Contributed by Ulrich Drepper , 2002. - * - * Copyright (C) 2009 Pierre-Marc Fournier - * Conversion to RCU list. - * Copyright (C) 2010 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _URCU_RCUHLIST_H diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h index 29dd88f..e0f4b35 100644 --- a/include/urcu/rculfhash.h +++ b/include/urcu/rculfhash.h @@ -1,28 +1,14 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFHASH_H #define _URCU_RCULFHASH_H /* - * urcu/rculfhash.h - * * Userspace RCU library - Lock-Free RCU Hash Table * - * Copyright 2011 - Mathieu Desnoyers - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * For use with URCU_API_MAP (API mapping of liburcu), include this file * _after_ including your URCU flavor. */ @@ -82,6 +68,18 @@ struct cds_lfht_iter { #endif }; +/* + * cds_lfht_alloc: Callbacks if we want to use custom memory allocator. + */ +struct cds_lfht_alloc { + void *(*malloc)(void *state, size_t size); + void *(*calloc)(void *state, size_t nmemb, size_t size); + void *(*realloc)(void *state, void *ptr, size_t size); + void *(*aligned_alloc)(void *state, size_t alignment, size_t size); + void (*free)(void *state, void *ptr); + void *state; +}; + static inline struct cds_lfht_node *cds_lfht_iter_get_node(struct cds_lfht_iter *iter) { @@ -109,6 +107,16 @@ void cds_lfht_node_init(struct cds_lfht_node *node __attribute__((unused))) { } +/* + * cds_lfht_node_init_deleted - initialize a hash table node to "removed" state + * @node: the node to initialize. + * + * Initialize the node such that cds_lfht_is_node_deleted() can be used + * on the node before it is added to a hash table. + */ +extern +void cds_lfht_node_init_deleted(struct cds_lfht_node *node); + /* * Hash table creation flags. */ @@ -119,7 +127,7 @@ enum { struct cds_lfht_mm_type { struct cds_lfht *(*alloc_cds_lfht)(unsigned long min_nr_alloc_buckets, - unsigned long max_nr_buckets); + unsigned long max_nr_buckets, const struct cds_lfht_alloc *alloc); void (*alloc_bucket_table)(struct cds_lfht *ht, unsigned long order); void (*free_bucket_table)(struct cds_lfht *ht, unsigned long order); struct cds_lfht_node *(*bucket_at)(struct cds_lfht *ht, @@ -142,6 +150,19 @@ struct cds_lfht *_cds_lfht_new(unsigned long init_size, const struct rcu_flavor_struct *flavor, pthread_attr_t *attr); +/* + * _cds_lfht_new_with_alloc - API used by cds_lfht_new_with_flavor_alloc. + */ +extern +struct cds_lfht *_cds_lfht_new_with_alloc(unsigned long init_size, + unsigned long min_nr_alloc_buckets, + unsigned long max_nr_buckets, + int flags, + const struct cds_lfht_mm_type *mm, + const struct rcu_flavor_struct *flavor, + const struct cds_lfht_alloc *alloc, + pthread_attr_t *attr); + /* * cds_lfht_new_flavor - allocate a hash table tied to a RCU flavor. * @init_size: number of buckets to allocate initially. Must be power of two. @@ -184,6 +205,52 @@ struct cds_lfht *cds_lfht_new_flavor(unsigned long init_size, flags, NULL, flavor, attr); } +/* + * cds_lfht_new_with_flavor_alloc - allocate a hash table tied to a RCU flavor. + * @init_size: number of buckets to allocate initially. Must be power of two. + * @min_nr_alloc_buckets: the minimum number of allocated buckets. + * (must be power of two) + * @max_nr_buckets: the maximum number of hash table buckets allowed. + * (must be power of two, 0 is accepted, means + * "infinite") + * @flavor: flavor of liburcu to use to synchronize the hash table + * @alloc: Custom memory allocator for hash table memory management. + * NULL for default. If a custom allocator is used, then + * the whole interface of struct cds_lfht_alloc must be implemented. + * @flags: hash table creation flags (can be combined with bitwise or: '|'). + * 0: no flags. + * CDS_LFHT_AUTO_RESIZE: automatically resize hash table. + * CDS_LFHT_ACCOUNTING: count the number of node addition + * and removal in the table + * @attr: optional resize worker thread attributes. NULL for default. + * + * Return NULL on error. + * Note: the RCU flavor must be already included before the hash table header. + * + * The programmer is responsible for ensuring that resize operation has a + * priority equal to hash table updater threads. It should be performed by + * specifying the appropriate priority in the pthread "attr" argument, and, + * for CDS_LFHT_AUTO_RESIZE, by ensuring that call_rcu worker threads also have + * this priority level. Having lower priority for call_rcu and resize threads + * does not pose any correctness issue, but the resize operations could be + * starved by updates, thus leading to long hash table bucket chains. + * Threads calling cds_lfht_new are NOT required to be registered RCU + * read-side threads. It can be called very early. (e.g. before RCU is + * initialized) + */ +static inline +struct cds_lfht *cds_lfht_new_with_flavor_alloc(unsigned long init_size, + unsigned long min_nr_alloc_buckets, + unsigned long max_nr_buckets, + int flags, + const struct rcu_flavor_struct *flavor, + const struct cds_lfht_alloc *alloc, + pthread_attr_t *attr) +{ + return _cds_lfht_new_with_alloc(init_size, min_nr_alloc_buckets, max_nr_buckets, + flags, NULL, flavor, alloc, attr); +} + #ifdef URCU_API_MAP /* @@ -237,16 +304,16 @@ struct cds_lfht *cds_lfht_new(unsigned long init_size, * * Return 0 on success, negative error value on error. + * Threads calling this API need to be registered RCU read-side threads. + * * Prior to liburcu 0.10: - * - Threads calling this API need to be registered RCU read-side - * threads. * - cds_lfht_destroy should *not* be called from a RCU read-side * critical section. It should *not* be called from a call_rcu thread * context neither. * * Starting from liburcu 0.10, rculfhash implements its own worker - * thread to handle resize operations, which removes RCU requirements on - * cds_lfht_destroy. + * thread to handle resize operations, which removes the above RCU + * read-side critical section requirement on cds_lfht_destroy. */ extern int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr); @@ -534,24 +601,27 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size); cds_lfht_next_duplicate(ht, match, key, iter), \ node = cds_lfht_iter_get_node(iter)) +#define cds_lfht_entry(ptr, type, member) \ + caa_container_of_check_null(ptr, type, member) + #define cds_lfht_for_each_entry(ht, iter, pos, member) \ for (cds_lfht_first(ht, iter), \ - pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - __typeof__(*(pos)), member); \ - cds_lfht_iter_get_node(iter) != NULL; \ + pos = cds_lfht_entry(cds_lfht_iter_get_node(iter), \ + __typeof__(*(pos)), member); \ + pos != NULL; \ cds_lfht_next(ht, iter), \ - pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - __typeof__(*(pos)), member)) + pos = cds_lfht_entry(cds_lfht_iter_get_node(iter), \ + __typeof__(*(pos)), member)) #define cds_lfht_for_each_entry_duplicate(ht, hash, match, key, \ iter, pos, member) \ for (cds_lfht_lookup(ht, hash, match, key, iter), \ - pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - __typeof__(*(pos)), member); \ - cds_lfht_iter_get_node(iter) != NULL; \ + pos = cds_lfht_entry(cds_lfht_iter_get_node(iter), \ + __typeof__(*(pos)), member); \ + pos != NULL; \ cds_lfht_next_duplicate(ht, match, key, iter), \ - pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - __typeof__(*(pos)), member)) + pos = cds_lfht_entry(cds_lfht_iter_get_node(iter), \ + __typeof__(*(pos)), member)) #ifdef __cplusplus } diff --git a/include/urcu/rculfqueue.h b/include/urcu/rculfqueue.h index 2c06247..0e3c910 100644 --- a/include/urcu/rculfqueue.h +++ b/include/urcu/rculfqueue.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFQUEUE_H #define _URCU_RCULFQUEUE_H /* - * rculfqueue.h - * * Userspace RCU library - Lock-Free RCU Queue - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/include/urcu/rculfstack.h b/include/urcu/rculfstack.h index c7e5599..b0f4221 100644 --- a/include/urcu/rculfstack.h +++ b/include/urcu/rculfstack.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFSTACK_H #define _URCU_RCULFSTACK_H /* - * rculfstack.h - * * Userspace RCU library - Lock-Free RCU Stack - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/rculist.h b/include/urcu/rculist.h index 753135e..9cd0a37 100644 --- a/include/urcu/rculist.h +++ b/include/urcu/rculist.h @@ -1,25 +1,12 @@ +// SPDX-FileCopyrightText: Free Software Foundation, Inc. +// SPDX-FileCopyrightText: 2009 Pierre-Marc Fournier +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * Copyright (C) 2002 Free Software Foundation, Inc. * (originally part of the GNU C Library) * Contributed by Ulrich Drepper , 2002. - * - * Copyright (C) 2009 Pierre-Marc Fournier - * Conversion to RCU list. - * Copyright (C) 2010 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _URCU_RCULIST_H diff --git a/include/urcu/ref.h b/include/urcu/ref.h index e7ab531..408cfe2 100644 --- a/include/urcu/ref.h +++ b/include/urcu/ref.h @@ -1,17 +1,15 @@ +// SPDX-FileCopyrightText: 2009 Novell Inc. +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-only + #ifndef _URCU_REF_H #define _URCU_REF_H /* * Userspace RCU - Reference counting * - * Copyright (C) 2009 Novell Inc. - * Copyright (C) 2010 Mathieu Desnoyers - * * Author: Jan Blunck - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. */ #include diff --git a/include/urcu/static/lfstack.h b/include/urcu/static/lfstack.h index a05acb4..d7e70d4 100644 --- a/include/urcu/static/lfstack.h +++ b/include/urcu/static/lfstack.h @@ -1,29 +1,15 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_STATIC_LFSTACK_H #define _URCU_STATIC_LFSTACK_H /* - * urcu/static/lfstack.h - * * Userspace RCU library - Lock-Free Stack * - * Copyright 2010-2012 - Mathieu Desnoyers - * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu/lfstack.h for * linking dynamically with the userspace rcu library. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -114,7 +100,7 @@ bool ___cds_lfs_empty_head(struct cds_lfs_head *head) static inline bool _cds_lfs_empty(cds_lfs_stack_ptr_t s) { - return ___cds_lfs_empty_head(CMM_LOAD_SHARED(s._s->head)); + return ___cds_lfs_empty_head(uatomic_load(&s._s->head, CMM_RELAXED)); } /* @@ -122,6 +108,8 @@ bool _cds_lfs_empty(cds_lfs_stack_ptr_t s) * * Does not require any synchronization with other push nor pop. * + * Operations before push are consistent when observed after associated pop. + * * Lock-free stack push is not subject to ABA problem, so no need to * take the RCU read-side lock. Even if "head" changes between two * uatomic_cmpxchg() invocations here (being popped, and then pushed @@ -167,7 +155,9 @@ bool _cds_lfs_push(cds_lfs_stack_ptr_t u_s, * uatomic_cmpxchg() implicit memory barrier orders earlier * stores to node before publication. */ - head = uatomic_cmpxchg(&s->head, old_head, new_head); + cmm_emit_legacy_smp_mb(); + head = uatomic_cmpxchg_mo(&s->head, old_head, new_head, + CMM_SEQ_CST, CMM_SEQ_CST); if (old_head == head) break; } @@ -179,6 +169,8 @@ bool _cds_lfs_push(cds_lfs_stack_ptr_t u_s, * * Returns NULL if stack is empty. * + * Operations after pop are consistent when observed before associated push. + * * __cds_lfs_pop needs to be synchronized using one of the following * techniques: * @@ -203,7 +195,7 @@ struct cds_lfs_node *___cds_lfs_pop(cds_lfs_stack_ptr_t u_s) struct cds_lfs_head *head, *next_head; struct cds_lfs_node *next; - head = _CMM_LOAD_SHARED(s->head); + head = uatomic_load(&s->head, CMM_CONSUME); if (___cds_lfs_empty_head(head)) return NULL; /* Empty stack */ @@ -212,12 +204,14 @@ struct cds_lfs_node *___cds_lfs_pop(cds_lfs_stack_ptr_t u_s) * memory barrier before uatomic_cmpxchg() in * cds_lfs_push. */ - cmm_smp_read_barrier_depends(); - next = _CMM_LOAD_SHARED(head->node.next); + next = uatomic_load(&head->node.next, CMM_RELAXED); next_head = caa_container_of(next, struct cds_lfs_head, node); - if (uatomic_cmpxchg(&s->head, head, next_head) == head) + if (uatomic_cmpxchg_mo(&s->head, head, next_head, + CMM_SEQ_CST, CMM_SEQ_CST) == head){ + cmm_emit_legacy_smp_mb(); return &head->node; + } /* busy-loop if head changed under us */ } } @@ -245,6 +239,7 @@ static inline struct cds_lfs_head *___cds_lfs_pop_all(cds_lfs_stack_ptr_t u_s) { struct __cds_lfs_stack *s = u_s._s; + struct cds_lfs_head *head; /* * Implicit memory barrier after uatomic_xchg() matches implicit @@ -256,7 +251,9 @@ struct cds_lfs_head *___cds_lfs_pop_all(cds_lfs_stack_ptr_t u_s) * taking care to order writes to each node prior to the full * memory barrier after this uatomic_xchg(). */ - return uatomic_xchg(&s->head, NULL); + head = uatomic_xchg_mo(&s->head, NULL, CMM_SEQ_CST); + cmm_emit_legacy_smp_mb(); + return head; } /* diff --git a/include/urcu/static/pointer.h b/include/urcu/static/pointer.h index 465a610..9dc0d3e 100644 --- a/include/urcu/static/pointer.h +++ b/include/urcu/static/pointer.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_POINTER_STATIC_H #define _URCU_POINTER_STATIC_H /* - * urcu/static/pointer.h - * * Userspace RCU header. Operations on pointers. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -93,23 +79,11 @@ extern "C" { /* * If p is const (the pointer itself, not what it points to), using * __typeof__(p) would declare a const variable, leading to - * -Wincompatible-pointer-types errors. Using `+ 0` makes it an rvalue and - * gets rid of the const-ness. + * -Wincompatible-pointer-types errors. Using the statement expression + * makes it an rvalue and gets rid of the const-ness. */ -#ifdef __URCU_DEREFERENCE_USE_ATOMIC_CONSUME -# define _rcu_dereference(p) __extension__ ({ \ - __typeof__(p + 0) _________p1; \ - __atomic_load(&(p), &_________p1, __ATOMIC_CONSUME); \ - (_________p1); \ - }) -#else -# define _rcu_dereference(p) __extension__ ({ \ - __typeof__(p) _________p1 = CMM_LOAD_SHARED(p); \ - cmm_smp_read_barrier_depends(); \ - (_________p1); \ - }) -#endif - +# define _rcu_dereference(p) \ + uatomic_load(&(p), CMM_CONSUME) /** * _rcu_cmpxchg_pointer - same as rcu_assign_pointer, but tests if the pointer * is as expected by "old". If succeeds, returns the previous pointer to the @@ -117,7 +91,7 @@ extern "C" { * using synchronize_rcu(). If fails (unexpected value), returns old (which * should not be freed !). * - * uatomic_cmpxchg() acts as both release and acquire barriers. + * uatomic_cmpxchg() acts as both release and acquire barriers on success. * * This macro is less than 10 lines long. The intent is that this macro * meets the 10-line criterion in LGPL, allowing this function to be @@ -128,8 +102,9 @@ extern "C" { ({ \ __typeof__(*p) _________pold = (old); \ __typeof__(*p) _________pnew = (_new); \ - uatomic_cmpxchg(p, _________pold, _________pnew); \ - }) + uatomic_cmpxchg_mo(p, _________pold, _________pnew, \ + CMM_SEQ_CST, CMM_RELAXED); \ + }); /** * _rcu_xchg_pointer - same as rcu_assign_pointer, but returns the previous @@ -146,17 +121,17 @@ extern "C" { __extension__ \ ({ \ __typeof__(*p) _________pv = (v); \ - uatomic_xchg(p, _________pv); \ + uatomic_xchg_mo(p, _________pv, \ + CMM_SEQ_CST); \ }) -#define _rcu_set_pointer(p, v) \ - do { \ - __typeof__(*p) _________pv = (v); \ - if (!__builtin_constant_p(v) || \ - ((v) != NULL)) \ - cmm_wmb(); \ - uatomic_set(p, _________pv); \ +#define _rcu_set_pointer(p, v) \ + do { \ + __typeof__(*p) _________pv = (v); \ + uatomic_store(p, _________pv, \ + __builtin_constant_p(v) && (v) == NULL ? \ + CMM_RELAXED : CMM_RELEASE); \ } while (0) /** diff --git a/include/urcu/static/rculfqueue.h b/include/urcu/static/rculfqueue.h index ad73454..03c4ecd 100644 --- a/include/urcu/static/rculfqueue.h +++ b/include/urcu/static/rculfqueue.h @@ -1,29 +1,15 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFQUEUE_STATIC_H #define _URCU_RCULFQUEUE_STATIC_H /* - * rculfqueue-static.h - * * Userspace RCU library - Lock-Free RCU Queue * - * Copyright 2010 - Mathieu Desnoyers - * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See rculfqueue.h for linking * dynamically with the userspace rcu library. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -148,26 +134,29 @@ void _cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, * uatomic_cmpxchg() implicit memory barrier orders earlier stores to * node before publication. */ - for (;;) { struct cds_lfq_node_rcu *tail, *next; tail = rcu_dereference(q->tail); - next = uatomic_cmpxchg(&tail->next, NULL, node); + cmm_emit_legacy_smp_mb(); + next = uatomic_cmpxchg_mo(&tail->next, NULL, node, + CMM_SEQ_CST, CMM_SEQ_CST); if (next == NULL) { /* * Tail was at the end of queue, we successfully * appended to it. Now move tail (another * enqueue might beat us to it, that's fine). */ - (void) uatomic_cmpxchg(&q->tail, tail, node); + (void) uatomic_cmpxchg_mo(&q->tail, tail, node, + CMM_SEQ_CST, CMM_SEQ_CST); return; } else { /* * Failure to append to current tail. * Help moving tail further and retry. */ - (void) uatomic_cmpxchg(&q->tail, tail, next); + (void) uatomic_cmpxchg_mo(&q->tail, tail, next, + CMM_SEQ_CST, CMM_SEQ_CST); continue; } } @@ -211,7 +200,8 @@ struct cds_lfq_node_rcu *_cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q) enqueue_dummy(q); next = rcu_dereference(head->next); } - if (uatomic_cmpxchg(&q->head, head, next) != head) + if (uatomic_cmpxchg_mo(&q->head, head, next, + CMM_SEQ_CST, CMM_SEQ_CST) != head) continue; /* Concurrently pushed. */ if (head->dummy) { /* Free dummy after grace period. */ diff --git a/include/urcu/static/rculfstack.h b/include/urcu/static/rculfstack.h index 54ff377..b44b9e2 100644 --- a/include/urcu/static/rculfstack.h +++ b/include/urcu/static/rculfstack.h @@ -1,29 +1,15 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFSTACK_STATIC_H #define _URCU_RCULFSTACK_STATIC_H /* - * rculfstack-static.h - * * Userspace RCU library - Lock-Free RCU Stack * - * Copyright 2010 - Mathieu Desnoyers - * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See rculfstack.h for linking * dynamically with the userspace rcu library. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -83,7 +69,9 @@ int _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, * uatomic_cmpxchg() implicit memory barrier orders earlier * stores to node before publication. */ - head = uatomic_cmpxchg(&s->head, old_head, node); + cmm_emit_legacy_smp_mb(); + head = uatomic_cmpxchg_mo(&s->head, old_head, node, + CMM_SEQ_CST, CMM_SEQ_CST); if (old_head == head) break; } @@ -108,7 +96,9 @@ _cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s) if (head) { struct cds_lfs_node_rcu *next = rcu_dereference(head->next); - if (uatomic_cmpxchg(&s->head, head, next) == head) { + if (uatomic_cmpxchg_mo(&s->head, head, next, + CMM_SEQ_CST, CMM_SEQ_CST) == head) { + cmm_emit_legacy_smp_mb(); return head; } else { /* Concurrent modification. Retry. */ diff --git a/include/urcu/static/urcu-bp.h b/include/urcu/static/urcu-bp.h index 8ba3830..e660154 100644 --- a/include/urcu/static/urcu-bp.h +++ b/include/urcu/static/urcu-bp.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_BP_STATIC_H #define _URCU_BP_STATIC_H /* - * urcu-bp-static.h - * * Userspace RCU header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -33,6 +19,7 @@ #include #include +#include #include #include #include @@ -117,7 +104,8 @@ static inline void urcu_bp_smp_mb_slave(void) cmm_smp_mb(); } -static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr) +static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr, + cmm_annotate_t *group) { unsigned long v; @@ -127,7 +115,9 @@ static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr) * Make sure both tests below are done on the same version of *value * to insure consistency. */ - v = CMM_LOAD_SHARED(*ctr); + v = uatomic_load(ctr, CMM_RELAXED); + cmm_annotate_group_mem_acquire(group, ctr); + if (!(v & URCU_BP_GP_CTR_NEST_MASK)) return URCU_BP_READER_INACTIVE; if (!((v ^ urcu_bp_gp.ctr) & URCU_BP_GP_CTR_PHASE)) @@ -137,9 +127,9 @@ static inline enum urcu_bp_state urcu_bp_reader_state(unsigned long *ctr) /* * Helper for _urcu_bp_read_lock(). The format of urcu_bp_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _urcu_bp_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_BP_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _urcu_bp_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The smp_mb_slave() ensures that the accesses in * _urcu_bp_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_bp_read_lock_update(unsigned long tmp) @@ -181,12 +171,14 @@ static inline void _urcu_bp_read_lock(void) static inline void _urcu_bp_read_unlock(void) { unsigned long tmp; + unsigned long *ctr = &URCU_TLS(urcu_bp_reader)->ctr; tmp = URCU_TLS(urcu_bp_reader)->ctr; urcu_assert_debug(tmp & URCU_BP_GP_CTR_NEST_MASK); /* Finish using rcu before decrementing the pointer. */ urcu_bp_smp_mb_slave(); - _CMM_STORE_SHARED(URCU_TLS(urcu_bp_reader)->ctr, tmp - URCU_BP_GP_COUNT); + cmm_annotate_mem_release(ctr); + uatomic_store(ctr, tmp - URCU_BP_GP_COUNT, CMM_RELAXED); cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */ } diff --git a/include/urcu/static/urcu-common.h b/include/urcu/static/urcu-common.h index 60ea8b8..d0fd06a 100644 --- a/include/urcu/static/urcu-common.h +++ b/include/urcu/static/urcu-common.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_COMMON_STATIC_H #define _URCU_COMMON_STATIC_H /* - * urcu-common-static.h - * * Userspace RCU header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -34,6 +20,7 @@ #include #include +#include #include #include #include @@ -105,7 +92,8 @@ static inline void urcu_common_wake_up_gp(struct urcu_gp *gp) } static inline enum urcu_state urcu_common_reader_state(struct urcu_gp *gp, - unsigned long *ctr) + unsigned long *ctr, + cmm_annotate_t *group) { unsigned long v; @@ -113,7 +101,9 @@ static inline enum urcu_state urcu_common_reader_state(struct urcu_gp *gp, * Make sure both tests below are done on the same version of *value * to insure consistency. */ - v = CMM_LOAD_SHARED(*ctr); + v = uatomic_load(ctr, CMM_RELAXED); + cmm_annotate_group_mem_acquire(group, ctr); + if (!(v & URCU_GP_CTR_NEST_MASK)) return URCU_READER_INACTIVE; if (!((v ^ gp->ctr) & URCU_GP_CTR_PHASE)) diff --git a/include/urcu/static/urcu-mb.h b/include/urcu/static/urcu-mb.h index b97e42a..8ddbd00 100644 --- a/include/urcu/static/urcu-mb.h +++ b/include/urcu/static/urcu-mb.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_MB_STATIC_H #define _URCU_MB_STATIC_H /* - * urcu-mb-static.h - * * Userspace RCU header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -63,9 +49,9 @@ extern DECLARE_URCU_TLS(struct urcu_reader, urcu_mb_reader); /* * Helper for _urcu_mb_read_lock(). The format of urcu_mb_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _urcu_mb_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The cmm_smp_mb() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _urcu_mb_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The cmm_smp_mb() ensures that the accesses in * _urcu_mb_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_mb_read_lock_update(unsigned long tmp) @@ -108,13 +94,14 @@ static inline void _urcu_mb_read_lock(void) */ static inline void _urcu_mb_read_unlock_update_and_wakeup(unsigned long tmp) { + unsigned long *ctr = &URCU_TLS(urcu_mb_reader).ctr; + if (caa_likely((tmp & URCU_GP_CTR_NEST_MASK) == URCU_GP_COUNT)) { - cmm_smp_mb(); - _CMM_STORE_SHARED(URCU_TLS(urcu_mb_reader).ctr, tmp - URCU_GP_COUNT); - cmm_smp_mb(); + uatomic_store(ctr, tmp - URCU_GP_COUNT, CMM_SEQ_CST); urcu_common_wake_up_gp(&urcu_mb_gp); - } else - _CMM_STORE_SHARED(URCU_TLS(urcu_mb_reader).ctr, tmp - URCU_GP_COUNT); + } else { + uatomic_store(ctr, tmp - URCU_GP_COUNT, CMM_RELAXED); + } } /* diff --git a/include/urcu/static/urcu-memb.h b/include/urcu/static/urcu-memb.h index c8d102f..b9178c8 100644 --- a/include/urcu/static/urcu-memb.h +++ b/include/urcu/static/urcu-memb.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_MEMB_STATIC_H #define _URCU_MEMB_STATIC_H /* - * urcu-memb-static.h - * * Userspace RCU header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -34,6 +20,7 @@ #include #include +#include #include #include #include @@ -86,18 +73,27 @@ extern DECLARE_URCU_TLS(struct urcu_reader, urcu_memb_reader); /* * Helper for _rcu_read_lock(). The format of urcu_memb_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _rcu_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in + * the per-thread rcu_reader.ctr) has the lower-order bits containing a count of + * _rcu_read_lock() nesting, and a single high-order URCU_BP_GP_CTR_PHASE bit + * that contains either zero or one. The smp_mb_slave() ensures that the accesses in * _rcu_read_lock() happen before the subsequent read-side critical section. */ static inline void _urcu_memb_read_lock_update(unsigned long tmp) { + unsigned long *ctr = &URCU_TLS(urcu_memb_reader).ctr; + if (caa_likely(!(tmp & URCU_GP_CTR_NEST_MASK))) { - _CMM_STORE_SHARED(URCU_TLS(urcu_memb_reader).ctr, _CMM_LOAD_SHARED(urcu_memb_gp.ctr)); + unsigned long *pgctr = &urcu_memb_gp.ctr; + unsigned long gctr = uatomic_load(pgctr, CMM_RELAXED); + + /* Paired with following mb slave. */ + cmm_annotate_mem_acquire(pgctr); + uatomic_store(ctr, gctr, CMM_RELAXED); + urcu_memb_smp_mb_slave(); - } else - _CMM_STORE_SHARED(URCU_TLS(urcu_memb_reader).ctr, tmp + URCU_GP_COUNT); + } else { + uatomic_store(ctr, tmp + URCU_GP_COUNT, CMM_RELAXED); + } } /* @@ -131,13 +127,17 @@ static inline void _urcu_memb_read_lock(void) */ static inline void _urcu_memb_read_unlock_update_and_wakeup(unsigned long tmp) { + unsigned long *ctr = &URCU_TLS(urcu_memb_reader).ctr; + if (caa_likely((tmp & URCU_GP_CTR_NEST_MASK) == URCU_GP_COUNT)) { urcu_memb_smp_mb_slave(); - _CMM_STORE_SHARED(URCU_TLS(urcu_memb_reader).ctr, tmp - URCU_GP_COUNT); + cmm_annotate_mem_release(ctr); + uatomic_store(ctr, tmp - URCU_GP_COUNT, CMM_RELAXED); urcu_memb_smp_mb_slave(); urcu_common_wake_up_gp(&urcu_memb_gp); - } else - _CMM_STORE_SHARED(URCU_TLS(urcu_memb_reader).ctr, tmp - URCU_GP_COUNT); + } else { + uatomic_store(ctr, tmp - URCU_GP_COUNT, CMM_RELAXED); + } } /* diff --git a/include/urcu/static/urcu-qsbr.h b/include/urcu/static/urcu-qsbr.h index b878877..de79883 100644 --- a/include/urcu/static/urcu-qsbr.h +++ b/include/urcu/static/urcu-qsbr.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_QSBR_STATIC_H #define _URCU_QSBR_STATIC_H /* - * urcu-qsbr-static.h - * * Userspace RCU QSBR header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -35,6 +21,7 @@ #include #include +#include #include #include #include @@ -96,11 +83,14 @@ static inline void urcu_qsbr_wake_up_gp(void) } } -static inline enum urcu_state urcu_qsbr_reader_state(unsigned long *ctr) +static inline enum urcu_state urcu_qsbr_reader_state(unsigned long *ctr, + cmm_annotate_t *group) { unsigned long v; - v = CMM_LOAD_SHARED(*ctr); + v = uatomic_load(ctr, CMM_RELAXED); + cmm_annotate_group_mem_acquire(group, ctr); + if (!v) return URCU_READER_INACTIVE; if (v == urcu_qsbr_gp.ctr) @@ -155,9 +145,9 @@ static inline int _urcu_qsbr_read_ongoing(void) */ static inline void _urcu_qsbr_quiescent_state_update_and_wakeup(unsigned long gp_ctr) { - cmm_smp_mb(); - _CMM_STORE_SHARED(URCU_TLS(urcu_qsbr_reader).ctr, gp_ctr); - cmm_smp_mb(); /* write URCU_TLS(urcu_qsbr_reader).ctr before read futex */ + uatomic_store(&URCU_TLS(urcu_qsbr_reader).ctr, gp_ctr, CMM_SEQ_CST); + + /* write URCU_TLS(urcu_qsbr_reader).ctr before read futex */ urcu_qsbr_wake_up_gp(); cmm_smp_mb(); } @@ -179,7 +169,8 @@ static inline void _urcu_qsbr_quiescent_state(void) unsigned long gp_ctr; urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered); - if ((gp_ctr = CMM_LOAD_SHARED(urcu_qsbr_gp.ctr)) == URCU_TLS(urcu_qsbr_reader).ctr) + gp_ctr = uatomic_load(&urcu_qsbr_gp.ctr, CMM_RELAXED); + if (gp_ctr == URCU_TLS(urcu_qsbr_reader).ctr) return; _urcu_qsbr_quiescent_state_update_and_wakeup(gp_ctr); } @@ -195,9 +186,8 @@ static inline void _urcu_qsbr_quiescent_state(void) static inline void _urcu_qsbr_thread_offline(void) { urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered); - cmm_smp_mb(); - CMM_STORE_SHARED(URCU_TLS(urcu_qsbr_reader).ctr, 0); - cmm_smp_mb(); /* write URCU_TLS(urcu_qsbr_reader).ctr before read futex */ + uatomic_store(&URCU_TLS(urcu_qsbr_reader).ctr, 0, CMM_SEQ_CST); + /* write URCU_TLS(urcu_qsbr_reader).ctr before read futex */ urcu_qsbr_wake_up_gp(); cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */ } @@ -212,9 +202,14 @@ static inline void _urcu_qsbr_thread_offline(void) */ static inline void _urcu_qsbr_thread_online(void) { + unsigned long *pctr = &URCU_TLS(urcu_qsbr_reader).ctr; + unsigned long ctr; + urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered); cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */ - _CMM_STORE_SHARED(URCU_TLS(urcu_qsbr_reader).ctr, CMM_LOAD_SHARED(urcu_qsbr_gp.ctr)); + ctr = uatomic_load(&urcu_qsbr_gp.ctr, CMM_RELAXED); + cmm_annotate_mem_acquire(&urcu_qsbr_gp.ctr); + uatomic_store(pctr, ctr, CMM_RELAXED); cmm_smp_mb(); } diff --git a/include/urcu/static/urcu-signal-nr.h b/include/urcu/static/urcu-signal-nr.h deleted file mode 100644 index a488f3a..0000000 --- a/include/urcu/static/urcu-signal-nr.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _STATIC_URCU_SIGNAL_NR_H -#define _STATIC_URCU_SIGNAL_NR_H - -/* - * static/urcu-signal-nr.h - * - * Userspace RCU header. - * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * IBM's contributions to this file may be relicensed under LGPLv2 or later. - */ - -/* - * The signal number used by the RCU library can be overridden with - * -DSIGRCU= when compiling the library. - * Provide backward compatibility for liburcu 0.3.x SIGURCU. - */ -#ifdef SIGURCU -#define SIGRCU SIGURCU -#endif - -#ifndef SIGRCU -#define SIGRCU SIGUSR1 -#endif - -#endif /* _STATIC_URCU_SIGNAL_NR_H */ diff --git a/include/urcu/static/urcu-signal.h b/include/urcu/static/urcu-signal.h deleted file mode 100644 index c7577d3..0000000 --- a/include/urcu/static/urcu-signal.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef _URCU_SIGNAL_STATIC_H -#define _URCU_SIGNAL_STATIC_H - -/* - * urcu-signal-static.h - * - * Userspace RCU header. - * - * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU - * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. - * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * IBM's contributions to this file may be relicensed under LGPLv2 or later. - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * This code section can only be included in LGPL 2.1 compatible source code. - * See below for the function call wrappers which can be used in code meant to - * be only linked with the Userspace RCU library. This comes with a small - * performance degradation on the read-side due to the added function calls. - * This is required to permit relinking with newer versions of the library. - */ - -extern struct urcu_gp urcu_signal_gp; - -extern DECLARE_URCU_TLS(struct urcu_reader, urcu_signal_reader); - -/* - * Helper for _rcu_read_lock(). The format of urcu_signal_gp.ctr (as well as - * the per-thread rcu_reader.ctr) has the upper bits containing a count of - * _rcu_read_lock() nesting, and a lower-order bit that contains either zero - * or URCU_GP_CTR_PHASE. The cmm_barrier() ensures that the accesses in - * _rcu_read_lock() happen before the subsequent read-side critical section. - */ -static inline void _urcu_signal_read_lock_update(unsigned long tmp) -{ - if (caa_likely(!(tmp & URCU_GP_CTR_NEST_MASK))) { - _CMM_STORE_SHARED(URCU_TLS(urcu_signal_reader).ctr, _CMM_LOAD_SHARED(urcu_signal_gp.ctr)); - cmm_barrier(); - } else - _CMM_STORE_SHARED(URCU_TLS(urcu_signal_reader).ctr, tmp + URCU_GP_COUNT); -} - -/* - * Enter an RCU read-side critical section. - * - * The first cmm_barrier() call ensures that the compiler does not reorder - * the body of _rcu_read_lock() with a mutex. - * - * This function and its helper are both less than 10 lines long. The - * intent is that this function meets the 10-line criterion in LGPL, - * allowing this function to be invoked directly from non-LGPL code. - */ -static inline void _urcu_signal_read_lock(void) -{ - unsigned long tmp; - - urcu_assert_debug(URCU_TLS(urcu_signal_reader).registered); - cmm_barrier(); - tmp = URCU_TLS(urcu_signal_reader).ctr; - urcu_assert_debug((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK); - _urcu_signal_read_lock_update(tmp); -} - -/* - * This is a helper function for _rcu_read_unlock(). - * - * The first cmm_barrier() call ensures that the critical section is - * seen to precede the store to rcu_reader.ctr. - * The second cmm_barrier() call ensures that we write to rcu_reader.ctr - * before reading the update-side futex. - */ -static inline void _urcu_signal_read_unlock_update_and_wakeup(unsigned long tmp) -{ - if (caa_likely((tmp & URCU_GP_CTR_NEST_MASK) == URCU_GP_COUNT)) { - cmm_barrier(); - _CMM_STORE_SHARED(URCU_TLS(urcu_signal_reader).ctr, tmp - URCU_GP_COUNT); - cmm_barrier(); - urcu_common_wake_up_gp(&urcu_signal_gp); - } else - _CMM_STORE_SHARED(URCU_TLS(urcu_signal_reader).ctr, tmp - URCU_GP_COUNT); -} - -/* - * Exit an RCU read-side critical section. Both this function and its - * helper are smaller than 10 lines of code, and are intended to be - * usable by non-LGPL code, as called out in LGPL. - */ -static inline void _urcu_signal_read_unlock(void) -{ - unsigned long tmp; - - urcu_assert_debug(URCU_TLS(urcu_signal_reader).registered); - tmp = URCU_TLS(urcu_signal_reader).ctr; - urcu_assert_debug(tmp & URCU_GP_CTR_NEST_MASK); - _urcu_signal_read_unlock_update_and_wakeup(tmp); - cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */ -} - -/* - * Returns whether within a RCU read-side critical section. - * - * This function is less than 10 lines long. The intent is that this - * function meets the 10-line criterion for LGPL, allowing this function - * to be invoked directly from non-LGPL code. - */ -static inline int _urcu_signal_read_ongoing(void) -{ - return URCU_TLS(urcu_signal_reader).ctr & URCU_GP_CTR_NEST_MASK; -} - -#ifdef __cplusplus -} -#endif - -#endif /* _URCU_SIGNAL_STATIC_H */ diff --git a/include/urcu/static/urcu.h b/include/urcu/static/urcu.h index b83e72b..c164ae3 100644 --- a/include/urcu/static/urcu.h +++ b/include/urcu/static/urcu.h @@ -1,36 +1,22 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_STATIC_H #define _URCU_STATIC_H /* - * urcu-static.h - * * Userspace RCU header. * * TO BE INCLUDED ONLY IN CODE THAT IS TO BE RECOMPILED ON EACH LIBURCU * RELEASE. See urcu.h for linking dynamically with the userspace rcu library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ /* Default is RCU_MEMBARRIER */ -#if !defined(RCU_MEMBARRIER) && !defined(RCU_MB) && !defined(RCU_SIGNAL) +#if !defined(RCU_MEMBARRIER) && !defined(RCU_MB) #define RCU_MEMBARRIER #endif @@ -42,8 +28,4 @@ #include #endif -#ifdef RCU_SIGNAL -#include -#endif - #endif /* _URCU_STATIC_H */ diff --git a/include/urcu/static/wfcqueue.h b/include/urcu/static/wfcqueue.h index 478e859..26741ae 100644 --- a/include/urcu/static/wfcqueue.h +++ b/include/urcu/static/wfcqueue.h @@ -1,30 +1,16 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011-2012 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFCQUEUE_STATIC_H #define _URCU_WFCQUEUE_STATIC_H /* - * urcu/static/wfcqueue.h - * * Userspace RCU library - Concurrent Queue with Wait-Free Enqueue/Blocking Dequeue * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu/wfcqueue.h for * linking dynamically with the userspace rcu library. - * - * Copyright 2010-2012 - Mathieu Desnoyers - * Copyright 2011-2012 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -91,6 +77,11 @@ static inline void _cds_wfcq_node_init(struct cds_wfcq_node *node) node->next = NULL; } +static inline void _cds_wfcq_node_init_atomic(struct cds_wfcq_node *node) +{ + uatomic_store(&node->next, NULL, CMM_RELAXED); +} + /* * cds_wfcq_init: initialize wait-free queue (with lock). Pair with * cds_wfcq_destroy(). @@ -153,8 +144,8 @@ static inline bool _cds_wfcq_empty(cds_wfcq_head_ptr_t u_head, * common case to ensure that dequeuers do not frequently access * enqueuer's tail->p cache line. */ - return CMM_LOAD_SHARED(head->node.next) == NULL - && CMM_LOAD_SHARED(tail->p) == &head->node; + return uatomic_load(&head->node.next, CMM_CONSUME) == NULL + && uatomic_load(&tail->p, CMM_CONSUME) == &head->node; } static inline void _cds_wfcq_dequeue_lock(struct cds_wfcq_head *head, @@ -188,7 +179,7 @@ static inline bool ___cds_wfcq_append(cds_wfcq_head_ptr_t u_head, * stores to data structure containing node and setting * node->next to NULL before publication. */ - old_tail = uatomic_xchg(&tail->p, new_tail); + old_tail = uatomic_xchg_mo(&tail->p, new_tail, CMM_SEQ_CST); /* * Implicit memory barrier after uatomic_xchg() orders store to @@ -199,7 +190,8 @@ static inline bool ___cds_wfcq_append(cds_wfcq_head_ptr_t u_head, * store will append "node" to the queue from a dequeuer * perspective. */ - CMM_STORE_SHARED(old_tail->next, new_head); + uatomic_store(&old_tail->next, new_head, CMM_RELEASE); + /* * Return false if queue was empty prior to adding the node, * else return true. @@ -210,8 +202,8 @@ static inline bool ___cds_wfcq_append(cds_wfcq_head_ptr_t u_head, /* * cds_wfcq_enqueue: enqueue a node into a wait-free queue. * - * Issues a full memory barrier before enqueue. No mutual exclusion is - * required. + * Operations prior to enqueue are consistant with respect to dequeuing or + * splicing and iterating. * * Returns false if the queue was empty prior to adding the node. * Returns true otherwise. @@ -220,6 +212,8 @@ static inline bool _cds_wfcq_enqueue(cds_wfcq_head_ptr_t head, struct cds_wfcq_tail *tail, struct cds_wfcq_node *new_tail) { + cmm_emit_legacy_smp_mb(); + return ___cds_wfcq_append(head, tail, new_tail, new_tail); } @@ -270,8 +264,10 @@ ___cds_wfcq_node_sync_next(struct cds_wfcq_node *node, int blocking) /* * Adaptative busy-looping waiting for enqueuer to complete enqueue. + * + * Load node.next before loading node's content */ - while ((next = CMM_LOAD_SHARED(node->next)) == NULL) { + while ((next = uatomic_load(&node->next, CMM_CONSUME)) == NULL) { if (___cds_wfcq_busy_wait(&attempt, blocking)) return CDS_WFCQ_WOULDBLOCK; } @@ -290,8 +286,7 @@ ___cds_wfcq_first(cds_wfcq_head_ptr_t u_head, if (_cds_wfcq_empty(__cds_wfcq_head_cast(head), tail)) return NULL; node = ___cds_wfcq_node_sync_next(&head->node, blocking); - /* Load head->node.next before loading node's content */ - cmm_smp_read_barrier_depends(); + return node; } @@ -343,16 +338,15 @@ ___cds_wfcq_next(cds_wfcq_head_ptr_t head __attribute__((unused)), * out if we reached the end of the queue, we first check * node->next as a common case to ensure that iteration on nodes * do not frequently access enqueuer's tail->p cache line. + * + * Load node->next before loading next's content */ - if ((next = CMM_LOAD_SHARED(node->next)) == NULL) { - /* Load node->next before tail->p */ - cmm_smp_rmb(); - if (CMM_LOAD_SHARED(tail->p) == node) + if ((next = uatomic_load(&node->next, CMM_CONSUME)) == NULL) { + if (uatomic_load(&tail->p, CMM_RELAXED) == node) return NULL; next = ___cds_wfcq_node_sync_next(node, blocking); } - /* Load node->next before loading next's content */ - cmm_smp_read_barrier_depends(); + return next; } @@ -414,7 +408,7 @@ ___cds_wfcq_dequeue_with_state(cds_wfcq_head_ptr_t u_head, return CDS_WFCQ_WOULDBLOCK; } - if ((next = CMM_LOAD_SHARED(node->next)) == NULL) { + if ((next = uatomic_load(&node->next, CMM_CONSUME)) == NULL) { /* * @node is probably the only node in the queue. * Try to move the tail to &q->head. @@ -422,17 +416,13 @@ ___cds_wfcq_dequeue_with_state(cds_wfcq_head_ptr_t u_head, * NULL if the cmpxchg succeeds. Should the * cmpxchg fail due to a concurrent enqueue, the * q->head.next will be set to the next node. - * The implicit memory barrier before - * uatomic_cmpxchg() orders load node->next - * before loading q->tail. - * The implicit memory barrier before uatomic_cmpxchg - * orders load q->head.next before loading node's - * content. */ - _cds_wfcq_node_init(&head->node); - if (uatomic_cmpxchg(&tail->p, node, &head->node) == node) { + _cds_wfcq_node_init_atomic(&head->node); + if (uatomic_cmpxchg_mo(&tail->p, node, &head->node, + CMM_SEQ_CST, CMM_SEQ_CST) == node) { if (state) *state |= CDS_WFCQ_STATE_LAST; + cmm_emit_legacy_smp_mb(); return node; } next = ___cds_wfcq_node_sync_next(node, blocking); @@ -442,7 +432,7 @@ ___cds_wfcq_dequeue_with_state(cds_wfcq_head_ptr_t u_head, * (currently NULL) back to its original value. */ if (!blocking && next == CDS_WFCQ_WOULDBLOCK) { - head->node.next = node; + uatomic_store(&head->node.next, node, CMM_RELAXED); return CDS_WFCQ_WOULDBLOCK; } } @@ -450,10 +440,9 @@ ___cds_wfcq_dequeue_with_state(cds_wfcq_head_ptr_t u_head, /* * Move queue head forward. */ - head->node.next = next; + uatomic_store(&head->node.next, next, CMM_RELAXED); + cmm_emit_legacy_smp_mb(); - /* Load q->head.next before loading node's content */ - cmm_smp_read_barrier_depends(); return node; } @@ -515,6 +504,8 @@ ___cds_wfcq_dequeue_nonblocking(cds_wfcq_head_ptr_t head, /* * __cds_wfcq_splice: enqueue all src_q nodes at the end of dest_q. * + * Operations after splice are consistant with respect to enqueue. + * * Dequeue all nodes from src_q. * dest_q must be already initialized. * Mutual exclusion for src_q should be ensured by the caller as @@ -548,10 +539,10 @@ ___cds_wfcq_splice( * uatomic_xchg, as well as tail pointer vs head node * address. */ - head = uatomic_xchg(&src_q_head->node.next, NULL); + head = uatomic_xchg_mo(&src_q_head->node.next, NULL, CMM_SEQ_CST); if (head) break; /* non-empty */ - if (CMM_LOAD_SHARED(src_q_tail->p) == &src_q_head->node) + if (uatomic_load(&src_q_tail->p, CMM_CONSUME) == &src_q_head->node) return CDS_WFCQ_RET_SRC_EMPTY; if (___cds_wfcq_busy_wait(&attempt, blocking)) return CDS_WFCQ_RET_WOULDBLOCK; @@ -563,7 +554,8 @@ ___cds_wfcq_splice( * concurrent enqueue on src_q, which exchanges the tail before * updating the previous tail's next pointer. */ - tail = uatomic_xchg(&src_q_tail->p, &src_q_head->node); + cmm_emit_legacy_smp_mb(); + tail = uatomic_xchg_mo(&src_q_tail->p, &src_q_head->node, CMM_SEQ_CST); /* * Append the spliced content of src_q into dest_q. Does not diff --git a/include/urcu/static/wfqueue.h b/include/urcu/static/wfqueue.h index d04f66f..0cb7b1b 100644 --- a/include/urcu/static/wfqueue.h +++ b/include/urcu/static/wfqueue.h @@ -1,29 +1,15 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFQUEUE_STATIC_H #define _URCU_WFQUEUE_STATIC_H /* - * wfqueue-static.h - * * Userspace RCU library - Queue with Wait-Free Enqueue/Blocking Dequeue * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See wfqueue.h for linking * dynamically with the userspace rcu library. - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -81,13 +67,14 @@ static inline void _cds_wfq_enqueue(struct cds_wfq_queue *q, * structure containing node and setting node->next to NULL before * publication. */ - old_tail = uatomic_xchg(&q->tail, &node->next); + cmm_emit_legacy_smp_mb(); + old_tail = uatomic_xchg_mo(&q->tail, &node->next, CMM_SEQ_CST); /* * At this point, dequeuers see a NULL old_tail->next, which indicates * that the queue is being appended to. The following store will append * "node" to the queue from a dequeuer perspective. */ - CMM_STORE_SHARED(*old_tail, node); + uatomic_store(old_tail, node, CMM_RELEASE); } /* @@ -102,7 +89,7 @@ ___cds_wfq_node_sync_next(struct cds_wfq_node *node) /* * Adaptative busy-looping waiting for enqueuer to complete enqueue. */ - while ((next = CMM_LOAD_SHARED(node->next)) == NULL) { + while ((next = uatomic_load(&node->next, CMM_CONSUME)) == NULL) { if (++attempt >= WFQ_ADAPT_ATTEMPTS) { (void) poll(NULL, 0, WFQ_WAIT); /* Wait for 10ms */ attempt = 0; @@ -129,7 +116,7 @@ ___cds_wfq_dequeue_blocking(struct cds_wfq_queue *q) /* * Queue is empty if it only contains the dummy node. */ - if (q->head == &q->dummy && CMM_LOAD_SHARED(q->tail) == &q->dummy.next) + if (q->head == &q->dummy && uatomic_load(&q->tail, CMM_CONSUME) == &q->dummy.next) return NULL; node = q->head; diff --git a/include/urcu/static/wfstack.h b/include/urcu/static/wfstack.h index 088e6e3..c46e97d 100644 --- a/include/urcu/static/wfstack.h +++ b/include/urcu/static/wfstack.h @@ -1,29 +1,15 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_STATIC_WFSTACK_H #define _URCU_STATIC_WFSTACK_H /* - * urcu/static/wfstack.h - * * Userspace RCU library - Stack with with wait-free push, blocking traversal. * * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu/wfstack.h for * linking dynamically with the userspace rcu library. - * - * Copyright 2010-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -124,7 +110,7 @@ static inline bool _cds_wfs_empty(cds_wfs_stack_ptr_t u_stack) { struct __cds_wfs_stack *s = u_stack._s; - return ___cds_wfs_end(CMM_LOAD_SHARED(s->head)); + return ___cds_wfs_end(uatomic_load(&s->head, CMM_RELAXED)); } /* @@ -133,6 +119,8 @@ static inline bool _cds_wfs_empty(cds_wfs_stack_ptr_t u_stack) * Issues a full memory barrier before push. No mutual exclusion is * required. * + * Operations before push are consistent when observed after associated pop. + * * Returns 0 if the stack was empty prior to adding the node. * Returns non-zero otherwise. */ @@ -148,12 +136,13 @@ int _cds_wfs_push(cds_wfs_stack_ptr_t u_stack, struct cds_wfs_node *node) * uatomic_xchg() implicit memory barrier orders earlier stores * to node (setting it to NULL) before publication. */ - old_head = uatomic_xchg(&s->head, new_head); + cmm_emit_legacy_smp_mb(); + old_head = uatomic_xchg_mo(&s->head, new_head, CMM_SEQ_CST); /* * At this point, dequeuers see a NULL node->next, they should * busy-wait until node->next is set to old_head. */ - CMM_STORE_SHARED(node->next, &old_head->node); + uatomic_store(&node->next, &old_head->node, CMM_RELEASE); return !___cds_wfs_end(old_head); } @@ -169,7 +158,7 @@ ___cds_wfs_node_sync_next(struct cds_wfs_node *node, int blocking) /* * Adaptative busy-looping waiting for push to complete. */ - while ((next = CMM_LOAD_SHARED(node->next)) == NULL) { + while ((next = uatomic_load(&node->next, CMM_CONSUME)) == NULL) { if (!blocking) return CDS_WFS_WOULDBLOCK; if (++attempt >= CDS_WFS_ADAPT_ATTEMPTS) { @@ -194,7 +183,7 @@ ___cds_wfs_pop(cds_wfs_stack_ptr_t u_stack, int *state, int blocking) if (state) *state = 0; for (;;) { - head = CMM_LOAD_SHARED(s->head); + head = uatomic_load(&s->head, CMM_CONSUME); if (___cds_wfs_end(head)) { return NULL; } @@ -203,9 +192,11 @@ ___cds_wfs_pop(cds_wfs_stack_ptr_t u_stack, int *state, int blocking) return CDS_WFS_WOULDBLOCK; } new_head = caa_container_of(next, struct cds_wfs_head, node); - if (uatomic_cmpxchg(&s->head, head, new_head) == head) { + if (uatomic_cmpxchg_mo(&s->head, head, new_head, + CMM_SEQ_CST, CMM_SEQ_CST) == head) { if (state && ___cds_wfs_end(new_head)) *state |= CDS_WFS_STATE_LAST; + cmm_emit_legacy_smp_mb(); return &head->node; } if (!blocking) { @@ -220,6 +211,8 @@ ___cds_wfs_pop(cds_wfs_stack_ptr_t u_stack, int *state, int blocking) * * Returns NULL if stack is empty. * + * Operations after pop push are consistent when observed before associated push. + * * __cds_wfs_pop_blocking needs to be synchronized using one of the * following techniques: * @@ -278,6 +271,8 @@ ___cds_wfs_pop_nonblocking(cds_wfs_stack_ptr_t u_stack) /* * __cds_wfs_pop_all: pop all nodes from a stack. * + * Operations after pop push are consistent when observed before associated push. + * * __cds_wfs_pop_all does not require any synchronization with other * push, nor with other __cds_wfs_pop_all, but requires synchronization * matching the technique used to synchronize __cds_wfs_pop_blocking: @@ -309,7 +304,8 @@ ___cds_wfs_pop_all(cds_wfs_stack_ptr_t u_stack) * taking care to order writes to each node prior to the full * memory barrier after this uatomic_xchg(). */ - head = uatomic_xchg(&s->head, CDS_WFS_END); + head = uatomic_xchg_mo(&s->head, CDS_WFS_END, CMM_SEQ_CST); + cmm_emit_legacy_smp_mb(); if (___cds_wfs_end(head)) return NULL; return head; diff --git a/include/urcu/syscall-compat.h b/include/urcu/syscall-compat.h index 23b266e..d49b988 100644 --- a/include/urcu/syscall-compat.h +++ b/include/urcu/syscall-compat.h @@ -1,30 +1,12 @@ +// SPDX-FileCopyrightText: 2013 Pierre-Luc St-Charles +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_SYSCALL_COMPAT_H #define _URCU_SYSCALL_COMPAT_H /* - * urcu/syscall-compat.h - * * Userspace RCU library - Syscall Compatibility Header - * - * Copyright 2013 - Pierre-Luc St-Charles - * - * Note: this file is only used to simplify the code required to - * include the 'syscall.h' system header across multiple platforms, - * which might not always be located at the same place (or needed at all). - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined(__ANDROID__) || defined(__sun__) || defined(__GNU__) @@ -33,7 +15,8 @@ #include #elif defined(__CYGWIN__) || defined(__APPLE__) || \ - defined(__FreeBSD__) || defined(__DragonFly__) + defined(__FreeBSD__) || defined(__DragonFly__) || \ + defined(__OpenBSD__) /* Don't include anything on these platforms. */ #else diff --git a/include/urcu/system.h b/include/urcu/system.h index faae390..139c37f 100644 --- a/include/urcu/system.h +++ b/include/urcu/system.h @@ -1,27 +1,37 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_SYSTEM_H #define _URCU_SYSTEM_H /* - * system.h - * * System definitions. - * - * Copyright (c) 2009 Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. */ +#include #include #include +#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS + +#define CMM_LOAD_SHARED(x) \ + __atomic_load_n(cmm_cast_volatile(&(x)), __ATOMIC_RELAXED) + +#define _CMM_LOAD_SHARED(x) CMM_LOAD_SHARED(x) + +#define CMM_STORE_SHARED(x, v) \ + __extension__ \ + ({ \ + __typeof__(v) _v = (v); \ + __atomic_store_n(cmm_cast_volatile(&(x)), _v, \ + __ATOMIC_RELAXED); \ + _v; \ + }) + +#define _CMM_STORE_SHARED(x, v) CMM_STORE_SHARED(x, v) + +#else /* * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come * before the load. @@ -56,4 +66,6 @@ _v = _v; /* Work around clang "unused result" */ \ }) +#endif /* CONFIG_RCU_USE_ATOMIC_BUILTINS */ + #endif /* _URCU_SYSTEM_H */ diff --git a/include/urcu/tls-compat.h b/include/urcu/tls-compat.h index a2c94de..1f3ef0f 100644 --- a/include/urcu/tls-compat.h +++ b/include/urcu/tls-compat.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_TLS_COMPAT_H #define _URCU_TLS_COMPAT_H /* - * urcu/tls-compat.h - * * Userspace RCU library - Thread-Local Storage Compatibility Header - * - * Copyright 2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -116,6 +102,7 @@ struct urcu_tls { type *__tls_access_ ## name(void) \ { \ static struct urcu_tls __tls_ ## name = { \ + .key = 0, \ .init_mutex = PTHREAD_MUTEX_INITIALIZER,\ .init_done = 0, \ }; \ @@ -132,9 +119,9 @@ struct urcu_tls { pthread_mutex_unlock(&__tls_ ## name.init_mutex); \ } \ cmm_smp_rmb(); /* read init_done before getting key */ \ - __tls_p = pthread_getspecific(__tls_ ## name.key); \ + __tls_p = (__typeof__(type) *) pthread_getspecific(__tls_ ## name.key); \ if (caa_unlikely(__tls_p == NULL)) { \ - __tls_p = calloc(1, sizeof(type)); \ + __tls_p = (__typeof__(type) *) calloc(1, sizeof(type)); \ do_init \ (void) pthread_setspecific(__tls_ ## name.key, \ __tls_p); \ diff --git a/include/urcu/uatomic.h b/include/urcu/uatomic.h index 2fb5fd4..561c829 100644 --- a/include/urcu/uatomic.h +++ b/include/urcu/uatomic.h @@ -1,29 +1,71 @@ -/* - * urcu/uatomic.h - * - * Copyright (c) 2020 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +// SPDX-FileCopyrightText: 2020 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later #ifndef _URCU_UATOMIC_H #define _URCU_UATOMIC_H #include +#include +#include + +enum cmm_memorder { + CMM_RELAXED = 0, + CMM_CONSUME = 1, + CMM_ACQUIRE = 2, + CMM_RELEASE = 3, + CMM_ACQ_REL = 4, + CMM_SEQ_CST = 5, + CMM_SEQ_CST_FENCE = 6, +}; + +#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS + +/* + * Make sure that CMM_SEQ_CST_FENCE is not equivalent to other memory orders. + */ +urcu_static_assert(CMM_RELAXED == __ATOMIC_RELAXED, "CMM_RELAXED vs __ATOMIC_RELAXED values mismatch", cmm_relaxed_values_mismatch); +urcu_static_assert(CMM_CONSUME == __ATOMIC_CONSUME, "CMM_CONSUME vs __ATOMIC_CONSUME values mismatch", cmm_consume_values_mismatch); +urcu_static_assert(CMM_ACQUIRE == __ATOMIC_ACQUIRE, "CMM_ACQUIRE vs __ATOMIC_ACQUIRE values mismatch", cmm_acquire_values_mismatch); +urcu_static_assert(CMM_RELEASE == __ATOMIC_RELEASE, "CMM_RELEASE vs __ATOMIC_RELEASE values mismatch", cmm_release_values_mismatch); +urcu_static_assert(CMM_ACQ_REL == __ATOMIC_ACQ_REL, "CMM_ACQ_REL vs __ATOMIC_ACQ_REL values mismatch", cmm_acq_rel_values_mismatch); +urcu_static_assert(CMM_SEQ_CST == __ATOMIC_SEQ_CST, "CMM_SEQ_CST vs __ATOMIC_SEQ_CST values mismatch", cmm_seq_cst_values_mismatch); + +/* + * This is not part of the public API. It it used internally to implement the + * CMM_SEQ_CST_FENCE memory order. + * + * NOTE: Using switch here instead of if statement to avoid -Wduplicated-cond + * warning when memory order is conditionally determined. + */ +static inline void cmm_seq_cst_fence_after_atomic(enum cmm_memorder mo) +{ + switch (mo) { + case CMM_SEQ_CST_FENCE: + cmm_smp_mb(); + break; + default: + break; + } +} + +#endif + +/* + * This is not part of the public API. It is used internally to convert from the + * CMM memory model to the C11 memory model. + */ +static inline int cmm_to_c11(int mo) +{ + if (mo == CMM_SEQ_CST_FENCE) { + return CMM_SEQ_CST; + } + return mo; +} -#if defined(URCU_ARCH_X86) +#if defined(CONFIG_RCU_USE_ATOMIC_BUILTINS) +#include +#elif defined(URCU_ARCH_X86) #include #elif defined(URCU_ARCH_PPC) #include @@ -51,6 +93,8 @@ #include #elif defined(URCU_ARCH_RISCV) #include +#elif defined(URCU_ARCH_LOONGARCH) +#include #else #error "Cannot build: unrecognized architecture, see ." #endif diff --git a/include/urcu/uatomic/aarch64.h b/include/urcu/uatomic/aarch64.h index 58698ce..31d428d 100644 --- a/include/urcu/uatomic/aarch64.h +++ b/include/urcu/uatomic/aarch64.h @@ -1,23 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_AARCH64_H #define _URCU_ARCH_UATOMIC_AARCH64_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation - * (Adapted from uatomic_arch_ppc.h) - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/alpha.h b/include/urcu/uatomic/alpha.h index 5dceb90..afa7dff 100644 --- a/include/urcu/uatomic/alpha.h +++ b/include/urcu/uatomic/alpha.h @@ -1,28 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_UATOMIC_ARCH_ALPHA_H #define _URCU_UATOMIC_ARCH_ALPHA_H /* * Atomic exchange operations for the Alpha architecture. Let GCC do it. - * - * Copyright (c) 2010 Paolo Bonzini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #include diff --git a/include/urcu/uatomic/arm.h b/include/urcu/uatomic/arm.h index 95f32f3..5124a71 100644 --- a/include/urcu/uatomic/arm.h +++ b/include/urcu/uatomic/arm.h @@ -1,25 +1,17 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_ARM_H #define _URCU_ARCH_UATOMIC_ARM_H /* * Atomics for ARM. This approach is usable on kernels back to 2.6.15. * - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation - * (Adapted from uatomic_arch_ppc.h) - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/builtins-generic.h b/include/urcu/uatomic/builtins-generic.h new file mode 100644 index 0000000..15c7f07 --- /dev/null +++ b/include/urcu/uatomic/builtins-generic.h @@ -0,0 +1,162 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +/* + * urcu/uatomic/builtins-generic.h + */ + +#ifndef _URCU_UATOMIC_BUILTINS_GENERIC_H +#define _URCU_UATOMIC_BUILTINS_GENERIC_H + +#include +#include + +#define uatomic_store(addr, v, mo) \ + do { \ + __atomic_store_n(cmm_cast_volatile(addr), v, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + } while (0) + +#define uatomic_set(addr, v) \ + do { \ + uatomic_store(addr, v, CMM_RELAXED); \ + } while (0) + +#define uatomic_load(addr, mo) \ + __extension__ \ + ({ \ + __typeof__(*(addr)) _value = \ + __atomic_load_n(cmm_cast_volatile(addr), \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + \ + _value; \ + }) + +#define uatomic_read(addr) \ + uatomic_load(addr, CMM_RELAXED) + +#define uatomic_cmpxchg_mo(addr, old, new, mos, mof) \ + __extension__ \ + ({ \ + __typeof__(*(addr)) _old = (__typeof__(*(addr)))old; \ + \ + if (__atomic_compare_exchange_n(cmm_cast_volatile(addr), \ + &_old, new, 0, \ + cmm_to_c11(mos), \ + cmm_to_c11(mof))) { \ + cmm_seq_cst_fence_after_atomic(mos); \ + } else { \ + cmm_seq_cst_fence_after_atomic(mof); \ + } \ + _old; \ + }) + +#define uatomic_cmpxchg(addr, old, new) \ + uatomic_cmpxchg_mo(addr, old, new, CMM_SEQ_CST_FENCE, CMM_RELAXED) + +#define uatomic_xchg_mo(addr, v, mo) \ + __extension__ \ + ({ \ + __typeof__((*addr)) _old = \ + __atomic_exchange_n(cmm_cast_volatile(addr), v, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + _old; \ + }) + +#define uatomic_xchg(addr, v) \ + uatomic_xchg_mo(addr, v, CMM_SEQ_CST_FENCE) + +#define uatomic_add_return_mo(addr, v, mo) \ + __extension__ \ + ({ \ + __typeof__(*(addr)) _old = \ + __atomic_add_fetch(cmm_cast_volatile(addr), v, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + _old; \ + }) + +#define uatomic_add_return(addr, v) \ + uatomic_add_return_mo(addr, v, CMM_SEQ_CST_FENCE) + +#define uatomic_sub_return_mo(addr, v, mo) \ + __extension__ \ + ({ \ + __typeof__(*(addr)) _old = \ + __atomic_sub_fetch(cmm_cast_volatile(addr), v, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + _old; \ + }) + +#define uatomic_sub_return(addr, v) \ + uatomic_sub_return_mo(addr, v, CMM_SEQ_CST_FENCE) + +#define uatomic_and_mo(addr, mask, mo) \ + do { \ + (void) __atomic_and_fetch(cmm_cast_volatile(addr), mask, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + } while (0) + +#define uatomic_and(addr, mask) \ + uatomic_and_mo(addr, mask, CMM_SEQ_CST) + +#define uatomic_or_mo(addr, mask, mo) \ + do { \ + (void) __atomic_or_fetch(cmm_cast_volatile(addr), mask, \ + cmm_to_c11(mo)); \ + cmm_seq_cst_fence_after_atomic(mo); \ + } while (0) + + +#define uatomic_or(addr, mask) \ + uatomic_or_mo(addr, mask, CMM_RELAXED) + +#define uatomic_add_mo(addr, v, mo) \ + (void) uatomic_add_return_mo(addr, v, mo) + +#define uatomic_add(addr, v) \ + uatomic_add_mo(addr, v, CMM_RELAXED) + +#define uatomic_sub_mo(addr, v, mo) \ + (void) uatomic_sub_return_mo(addr, v, mo) + +#define uatomic_sub(addr, v) \ + uatomic_sub_mo(addr, v, CMM_RELAXED) + +#define uatomic_inc_mo(addr, mo) \ + uatomic_add_mo(addr, 1, mo) + +#define uatomic_inc(addr) \ + uatomic_inc_mo(addr, CMM_RELAXED) + +#define uatomic_dec_mo(addr, mo) \ + uatomic_sub_mo(addr, 1, mo) + +#define uatomic_dec(addr) \ + uatomic_dec_mo(addr, CMM_RELAXED) + +#define cmm_smp_mb__before_uatomic_and() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_and() cmm_smp_mb() + +#define cmm_smp_mb__before_uatomic_or() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_or() cmm_smp_mb() + +#define cmm_smp_mb__before_uatomic_add() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_add() cmm_smp_mb() + +#define cmm_smp_mb__before_uatomic_sub() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_sub() cmm_smp_mb() + +#define cmm_smp_mb__before_uatomic_inc() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_inc() cmm_smp_mb() + +#define cmm_smp_mb__before_uatomic_dec() cmm_smp_mb() +#define cmm_smp_mb__after_uatomic_dec() cmm_smp_mb() + +#endif /* _URCU_UATOMIC_BUILTINS_X86_H */ diff --git a/include/urcu/uatomic/builtins.h b/include/urcu/uatomic/builtins.h new file mode 100644 index 0000000..5b92700 --- /dev/null +++ b/include/urcu/uatomic/builtins.h @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +/* + * urcu/uatomic/builtins.h + */ + +#ifndef _URCU_UATOMIC_BUILTINS_H +#define _URCU_UATOMIC_BUILTINS_H + +#include + +#if defined(__has_builtin) +# if !__has_builtin(__atomic_store_n) +# error "Toolchain does not support __atomic_store_n." +# endif +# if !__has_builtin(__atomic_load_n) +# error "Toolchain does not support __atomic_load_n." +# endif +# if !__has_builtin(__atomic_exchange_n) +# error "Toolchain does not support __atomic_exchange_n." +# endif +# if !__has_builtin(__atomic_compare_exchange_n) +# error "Toolchain does not support __atomic_compare_exchange_n." +# endif +# if !__has_builtin(__atomic_add_fetch) +# error "Toolchain does not support __atomic_add_fetch." +# endif +# if !__has_builtin(__atomic_sub_fetch) +# error "Toolchain does not support __atomic_sub_fetch." +# endif +# if !__has_builtin(__atomic_or_fetch) +# error "Toolchain does not support __atomic_or_fetch." +# endif +# if !__has_builtin(__atomic_thread_fence) +# error "Toolchain does not support __atomic_thread_fence." +# endif +# if !__has_builtin(__atomic_signal_fence) +# error "Toolchain does not support __atomic_signal_fence." +# endif +#elif defined(__GNUC__) +# define GCC_VERSION (__GNUC__ * 10000 + \ + __GNUC_MINOR__ * 100 + \ + __GNUC_PATCHLEVEL__) +# if GCC_VERSION < 40700 +# error "GCC version is too old. Version must be 4.7 or greater" +# endif +# undef GCC_VERSION +#else +# error "Toolchain is not supported." +#endif + +#if defined(__GNUC__) +# define UATOMIC_HAS_ATOMIC_BYTE __GCC_ATOMIC_CHAR_LOCK_FREE +# define UATOMIC_HAS_ATOMIC_SHORT __GCC_ATOMIC_SHORT_LOCK_FREE +#elif defined(__clang__) +# define UATOMIC_HAS_ATOMIC_BYTE __CLANG_ATOMIC_CHAR_LOCK_FREE +# define UATOMIC_HAS_ATOMIC_SHORT __CLANG_ATOMIC_SHORT_LOCK_FREE +#else +/* # define UATOMIC_HAS_ATOMIC_BYTE */ +/* # define UATOMIC_HAS_ATOMIC_SHORT */ +#endif + +#include + +#endif /* _URCU_UATOMIC_BUILTINS_H */ diff --git a/include/urcu/uatomic/gcc.h b/include/urcu/uatomic/gcc.h index 438e039..e0763af 100644 --- a/include/urcu/uatomic/gcc.h +++ b/include/urcu/uatomic/gcc.h @@ -1,23 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_GCC_H #define _URCU_ARCH_UATOMIC_GCC_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation - * (Adapted from uatomic_arch_ppc.h) - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/generic.h b/include/urcu/uatomic/generic.h index 89d1cfa..ed655bb 100644 --- a/include/urcu/uatomic/generic.h +++ b/include/urcu/uatomic/generic.h @@ -1,22 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_UATOMIC_GENERIC_H #define _URCU_UATOMIC_GENERIC_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2010 Paolo Bonzini - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ @@ -33,24 +26,125 @@ extern "C" { #define uatomic_set(addr, v) ((void) CMM_STORE_SHARED(*(addr), (v))) #endif +/* + * Can be defined for the architecture. + * + * What needs to be emitted _before_ the `operation' with memory ordering `mo'. + */ +#ifndef _cmm_compat_c11_smp_mb__before_mo +# define _cmm_compat_c11_smp_mb__before_mo(operation, mo) cmm_smp_mb() +#endif + +/* + * Can be defined for the architecture. + * + * What needs to be emitted _after_ the `operation' with memory ordering `mo'. + */ +#ifndef _cmm_compat_c11_smp_mb__after_mo +# define _cmm_compat_c11_smp_mb__after_mo(operation, mo) cmm_smp_mb() +#endif + +#define uatomic_load_store_return_op(op, addr, v, mo) \ + __extension__ \ + ({ \ + _cmm_compat_c11_smp_mb__before_mo(op, mo); \ + __typeof__((*addr)) _value = op(addr, v); \ + _cmm_compat_c11_smp_mb__after_mo(op, mo); \ + \ + _value; \ + }) + +#define uatomic_load_store_op(op, addr, v, mo) \ + do { \ + _cmm_compat_c11_smp_mb__before_mo(op, mo); \ + op(addr, v); \ + _cmm_compat_c11_smp_mb__after_mo(op, mo); \ + } while (0) + +#define uatomic_store(addr, v, mo) \ + do { \ + _cmm_compat_c11_smp_mb__before_mo(uatomic_set, mo); \ + uatomic_set(addr, v); \ + _cmm_compat_c11_smp_mb__after_mo(uatomic_set, mo); \ + } while (0) + +#define uatomic_and_mo(addr, v, mo) \ + uatomic_load_store_op(uatomic_and, addr, v, mo) + +#define uatomic_or_mo(addr, v, mo) \ + uatomic_load_store_op(uatomic_or, addr, v, mo) + +#define uatomic_add_mo(addr, v, mo) \ + uatomic_load_store_op(uatomic_add, addr, v, mo) + +#define uatomic_sub_mo(addr, v, mo) \ + uatomic_load_store_op(uatomic_sub, addr, v, mo) + +#define uatomic_inc_mo(addr, mo) \ + uatomic_load_store_op(uatomic_add, addr, 1, mo) + +#define uatomic_dec_mo(addr, mo) \ + uatomic_load_store_op(uatomic_add, addr, -1, mo) +/* + * NOTE: We can not just do switch (_value == (old) ? mos : mof) otherwise the + * compiler emit a -Wduplicated-cond warning. + */ +#define uatomic_cmpxchg_mo(addr, old, new, mos, mof) \ + __extension__ \ + ({ \ + _cmm_compat_c11_smp_mb__before_mo(uatomic_cmpxchg, mos); \ + __typeof__(*(addr)) _value = uatomic_cmpxchg(addr, old, \ + new); \ + \ + if (_value == (old)) { \ + _cmm_compat_c11_smp_mb__after_mo(uatomic_cmpxchg, mos); \ + } else { \ + _cmm_compat_c11_smp_mb__after_mo(uatomic_cmpxchg, mof); \ + } \ + _value; \ + }) + +#define uatomic_xchg_mo(addr, v, mo) \ + uatomic_load_store_return_op(uatomic_xchg, addr, v, mo) + +#define uatomic_add_return_mo(addr, v, mo) \ + uatomic_load_store_return_op(uatomic_add_return, addr, v) + +#define uatomic_sub_return_mo(addr, v, mo) \ + uatomic_load_store_return_op(uatomic_sub_return, addr, v) + #ifndef uatomic_read #define uatomic_read(addr) CMM_LOAD_SHARED(*(addr)) #endif +#define uatomic_load(addr, mo) \ + __extension__ \ + ({ \ + _cmm_compat_c11_smp_mb__before_mo(uatomic_read, mo); \ + __typeof__(*(addr)) _rcu_value = uatomic_read(addr); \ + _cmm_compat_c11_smp_mb__after_mo(uatomic_read, mo); \ + \ + _rcu_value; \ + }) + #if !defined __OPTIMIZE__ || defined UATOMIC_NO_LINK_ERROR -static inline __attribute__((always_inline, noreturn)) +#ifdef ILLEGAL_INSTR +static inline __attribute__((always_inline)) void _uatomic_link_error(void) { -#ifdef ILLEGAL_INSTR /* * generate an illegal instruction. Cannot catch this with * linker tricks when optimizations are disabled. */ __asm__ __volatile__(ILLEGAL_INSTR); +} #else +static inline __attribute__((always_inline, __noreturn__)) +void _uatomic_link_error(void) +{ __builtin_trap(); -#endif } +#endif #else /* #if !defined __OPTIMIZE__ || defined UATOMIC_NO_LINK_ERROR */ extern void _uatomic_link_error(void); diff --git a/include/urcu/uatomic/hppa.h b/include/urcu/uatomic/hppa.h index 2102153..8286461 100644 --- a/include/urcu/uatomic/hppa.h +++ b/include/urcu/uatomic/hppa.h @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2014 Helge Deller +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_ARCH_UATOMIC_HPPA_H #define _URCU_ARCH_UATOMIC_HPPA_H diff --git a/include/urcu/uatomic/ia64.h b/include/urcu/uatomic/ia64.h index b5db8cc..381594c 100644 --- a/include/urcu/uatomic/ia64.h +++ b/include/urcu/uatomic/ia64.h @@ -1,23 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_IA64_H #define _URCU_ARCH_UATOMIC_IA64_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation - * (Adapted from uatomic_arch_ppc.h) - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/loongarch.h b/include/urcu/uatomic/loongarch.h new file mode 100644 index 0000000..3454d41 --- /dev/null +++ b/include/urcu/uatomic/loongarch.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2021 Wang Jing +// +// SPDX-License-Identifier: MIT + +#ifndef _URCU_UATOMIC_ARCH_LOONGARCH_H +#define _URCU_UATOMIC_ARCH_LOONGARCH_H + +/* + * Atomic exchange operations for the LoongArch architecture. Let GCC do it. + */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * LoongArch implements byte and short atomics with LL/SC instructions, + * which retry if the cache line is modified concurrently between LL and + * SC. + */ +#define UATOMIC_HAS_ATOMIC_BYTE +#define UATOMIC_HAS_ATOMIC_SHORT + +#ifdef __cplusplus +} +#endif + +#include + +#endif /* _URCU_UATOMIC_ARCH_LOONGARCH_H */ diff --git a/include/urcu/uatomic/m68k.h b/include/urcu/uatomic/m68k.h index 60b01c7..9a28e7c 100644 --- a/include/urcu/uatomic/m68k.h +++ b/include/urcu/uatomic/m68k.h @@ -1,25 +1,9 @@ +// SPDX-FileCopyrightText: 2017 Michael Jeanson +// +// SPDX-License-Identifier: MIT + /* * Atomic exchange operations for the m68k architecture. Let GCC do it. - * - * Copyright (c) 2017 Michael Jeanson - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #ifndef _URCU_ARCH_UATOMIC_M68K_H diff --git a/include/urcu/uatomic/mips.h b/include/urcu/uatomic/mips.h index bd7ca7f..265401d 100644 --- a/include/urcu/uatomic/mips.h +++ b/include/urcu/uatomic/mips.h @@ -1,28 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_UATOMIC_ARCH_MIPS_H #define _URCU_UATOMIC_ARCH_MIPS_H /* * Atomic exchange operations for the MIPS architecture. Let GCC do it. - * - * Copyright (c) 2010 Paolo Bonzini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #include diff --git a/include/urcu/uatomic/nios2.h b/include/urcu/uatomic/nios2.h index 5b3c303..0eca727 100644 --- a/include/urcu/uatomic/nios2.h +++ b/include/urcu/uatomic/nios2.h @@ -1,28 +1,12 @@ +// SPDX-FileCopyrightText: 2016 Marek Vasut +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_UATOMIC_ARCH_NIOS2_H #define _URCU_UATOMIC_ARCH_NIOS2_H /* * Atomic exchange operations for the NIOS2 architecture. Let GCC do it. - * - * Copyright (c) 2016 Marek Vasut - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #include diff --git a/include/urcu/uatomic/ppc.h b/include/urcu/uatomic/ppc.h index 0e672f5..dc59518 100644 --- a/include/urcu/uatomic/ppc.h +++ b/include/urcu/uatomic/ppc.h @@ -1,21 +1,14 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_PPC_H #define _URCU_ARCH_UATOMIC_PPC_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ @@ -34,7 +27,7 @@ extern "C" { * instructions for cmpxchg and add_return family of atomic primitives. * * This is achieved with: - * lwsync (prior loads can be reordered after following load) + * lwsync (prior stores can be reordered after following loads) * lwarx * stwcx. * test if success (retry) diff --git a/include/urcu/uatomic/riscv.h b/include/urcu/uatomic/riscv.h index a6700e1..c1ba29e 100644 --- a/include/urcu/uatomic/riscv.h +++ b/include/urcu/uatomic/riscv.h @@ -1,25 +1,11 @@ +// SPDX-FileCopyrightText: 2018 Michael Jeanson +// +// SPDX-License-Identifier: MIT + /* - * Atomic exchange operations for the RISC-V architecture. Let GCC do it. - * - * Copyright (c) 2018 Michael Jeanson - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Atomic exchange operations for the RISC-V architecture. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. + * Let the compiler do it. */ #ifndef _URCU_ARCH_UATOMIC_RISCV_H @@ -28,6 +14,20 @@ #include #include +/* + * See for details. + * + * Until the following patches are backported, Userspace RCU is broken for the + * RISC-V architecture when compiled with GCC. + * + * - + * - + * - + */ +#ifdef URCU_GCC_VERSION +# error "Implementations of some atomic operations of GCC for RISC-V are insufficient for sequential consistency. For this reason Userspace RCU is currently marked as 'broken' for RISC-V with GCC. However, it is still possible to use other toolchains." +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/include/urcu/uatomic/s390.h b/include/urcu/uatomic/s390.h index 42f23e7..2562696 100644 --- a/include/urcu/uatomic/s390.h +++ b/include/urcu/uatomic/s390.h @@ -1,3 +1,8 @@ +// SPDX-FileCopyrightText: 2009 Novell, Inc. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT + #ifndef _URCU_UATOMIC_ARCH_S390_H #define _URCU_UATOMIC_ARCH_S390_H @@ -6,27 +11,7 @@ * taken from the Principles of Operation Appendix A "Conditional Swapping * Instructions (CS, CDS)". * - * Copyright (c) 2009 Novell, Inc. * Author: Jan Blunck - * Copyright (c) 2009 Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ #include diff --git a/include/urcu/uatomic/sparc64.h b/include/urcu/uatomic/sparc64.h index a9f2795..97ecb46 100644 --- a/include/urcu/uatomic/sparc64.h +++ b/include/urcu/uatomic/sparc64.h @@ -1,21 +1,14 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2003 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_SPARC64_H #define _URCU_ARCH_UATOMIC_SPARC64_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. - * Copyright (c) 2009 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/tile.h b/include/urcu/uatomic/tile.h index 830f260..412c9ed 100644 --- a/include/urcu/uatomic/tile.h +++ b/include/urcu/uatomic/tile.h @@ -1,23 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009-2015 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_TILE_H #define _URCU_ARCH_UATOMIC_TILE_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009-2015 Mathieu Desnoyers - * Copyright (c) 2010 Paul E. McKenney, IBM Corporation - * (Adapted from uatomic_arch_ppc.h) - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ diff --git a/include/urcu/uatomic/x86.h b/include/urcu/uatomic/x86.h index f4e1887..616eee9 100644 --- a/include/urcu/uatomic/x86.h +++ b/include/urcu/uatomic/x86.h @@ -1,21 +1,16 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_ARCH_UATOMIC_X86_H #define _URCU_ARCH_UATOMIC_X86_H +#include /* For abort(3). */ + /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ @@ -529,7 +524,7 @@ void __uatomic_dec(void *addr, int len) #define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr)))) -#if ((CAA_BITS_PER_LONG != 64) && defined(URCU_ARCH_I386)) +#ifdef URCU_ARCH_X86_NO_CAS /* For backwards compat */ #define CONFIG_RCU_COMPAT_ARCH 1 @@ -637,6 +632,474 @@ extern unsigned long _compat_uatomic_add_return(void *addr, #define cmm_smp_mb__before_uatomic_dec() cmm_barrier() #define cmm_smp_mb__after_uatomic_dec() cmm_barrier() +static inline void _cmm_compat_c11_smp_mb__before_uatomic_read_mo(enum cmm_memorder mo) +{ + /* + * A SMP barrier is not necessary for CMM_SEQ_CST because, only a + * previous store can be reordered with the load. However, emitting the + * memory barrier after the store is sufficient to prevent reordering + * between the two. This follows toolchains decision of emitting the + * memory fence on the stores instead of the loads. + * + * A compiler barrier is necessary because the underlying operation does + * not clobber the registers. + */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + cmm_barrier(); + break; + case CMM_ACQ_REL: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + default: + abort(); + break; + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_read_mo(enum cmm_memorder mo) +{ + /* + * A SMP barrier is not necessary for CMM_SEQ_CST because following + * loads and stores cannot be reordered with the load. + * + * A SMP barrier is however necessary for CMM_SEQ_CST_FENCE to respect + * the memory model, since the underlying operation does not have a lock + * prefix. + * + * A compiler barrier is necessary because the underlying operation does + * not clobber the registers. + */ + switch (mo) { + case CMM_SEQ_CST_FENCE: + cmm_smp_mb(); + break; + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_SEQ_CST: + cmm_barrier(); + break; + case CMM_ACQ_REL: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + default: + abort(); + break; + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_set_mo(enum cmm_memorder mo) +{ + /* + * A SMP barrier is not necessary for CMM_SEQ_CST because the store can + * only be reodered with later loads + * + * A compiler barrier is necessary because the underlying operation does + * not clobber the registers. + */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + cmm_barrier(); + break; + case CMM_ACQ_REL: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + default: + abort(); + break; + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_set_mo(enum cmm_memorder mo) +{ + /* + * A SMP barrier is necessary for CMM_SEQ_CST because the store can be + * reorded with later loads. Since no memory barrier is being emitted + * before loads, one has to be emitted after the store. This follows + * toolchains decision of emitting the memory fence on the stores instead + * of the loads. + * + * A SMP barrier is necessary for CMM_SEQ_CST_FENCE to respect the + * memory model, since the underlying store does not have a lock prefix. + * + * A compiler barrier is necessary because the underlying operation does + * not clobber the registers. + */ + switch (mo) { + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + cmm_smp_mb(); + break; + case CMM_RELAXED: /* Fall-through */ + case CMM_RELEASE: + cmm_barrier(); + break; + case CMM_ACQ_REL: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + default: + abort(); + break; + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_xchg_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_xchg has implicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_xchg_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_xchg has implicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_cmpxchg_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_cmpxchg has implicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_cmpxchg_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_cmpxchg has implicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_and_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_and has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_and_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_and has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_or_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_or has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_or_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_or has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_add_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_add has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_add_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_add has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_sub_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_sub has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_sub_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_sub has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_inc_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_inc has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_inc_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_inc has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_dec_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_dec has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_dec_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_dec has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_add_return_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_add_return has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_add_return_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_add_return has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__before_uatomic_sub_return_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_sub_return has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +static inline void _cmm_compat_c11_smp_mb__after_uatomic_sub_return_mo(enum cmm_memorder mo) +{ + /* NOP. uatomic_sub_return has explicit lock prefix. */ + switch (mo) { + case CMM_RELAXED: /* Fall-through */ + case CMM_ACQUIRE: /* Fall-through */ + case CMM_CONSUME: /* Fall-through */ + case CMM_RELEASE: /* Fall-through */ + case CMM_ACQ_REL: /* Fall-through */ + case CMM_SEQ_CST: /* Fall-through */ + case CMM_SEQ_CST_FENCE: + break; + default: + abort(); + } +} + +#define _cmm_compat_c11_smp_mb__before_mo(operation, mo) \ + do { \ + _cmm_compat_c11_smp_mb__before_ ## operation ## _mo (mo); \ + } while (0) + +#define _cmm_compat_c11_smp_mb__after_mo(operation, mo) \ + do { \ + _cmm_compat_c11_smp_mb__after_ ## operation ## _mo (mo); \ + } while (0) + + #ifdef __cplusplus } #endif diff --git a/include/urcu/uatomic_arch.h b/include/urcu/uatomic_arch.h index baaa7a7..5c3510f 100644 --- a/include/urcu/uatomic_arch.h +++ b/include/urcu/uatomic_arch.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #warning "urcu/uatomic_arch.h is deprecated. Please include urcu/uatomic.h instead." #include diff --git a/include/urcu/urcu-bp.h b/include/urcu/urcu-bp.h index 2ea17e6..152c536 100644 --- a/include/urcu/urcu-bp.h +++ b/include/urcu/urcu-bp.h @@ -1,45 +1,28 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_BP_H #define _URCU_BP_H /* - * urcu-bp.h - * * Userspace RCU header, "bulletproof" version. * * Slower RCU read-side adapted for tracing library. Does not require thread * registration nor unregistration. Also signal-safe. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ #include #include - -#ifdef __cplusplus -extern "C" { -#endif +#include #include @@ -56,6 +39,11 @@ extern "C" { * publication headers. */ #include +#include + +#ifdef __cplusplus +extern "C" { +#endif #ifdef _LGPL_SOURCE @@ -140,6 +128,12 @@ extern void *urcu_bp_set_pointer_sym(void **p, void *v); extern void urcu_bp_synchronize_rcu(void); +/* + * RCU grace period polling API. + */ +extern struct urcu_gp_poll_state urcu_bp_start_poll_synchronize_rcu(void); +extern bool urcu_bp_poll_state_synchronize_rcu(struct urcu_gp_poll_state state); + /* * urcu_bp_before_fork, urcu_bp_after_fork_parent and urcu_bp_after_fork_child * should be called around fork() system calls when the child process is not diff --git a/include/urcu/urcu-futex.h b/include/urcu/urcu-futex.h index a1abffb..65c2a6b 100644 --- a/include/urcu/urcu-futex.h +++ b/include/urcu/urcu-futex.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #warning "urcu/urcu-futex.h is deprecated. Please include urcu/futex.h instead." #include diff --git a/include/urcu/urcu-mb.h b/include/urcu/urcu-mb.h index ab485f1..acd02d0 100644 --- a/include/urcu/urcu-mb.h +++ b/include/urcu/urcu-mb.h @@ -1,44 +1,32 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_MB_H #define _URCU_MB_H /* - * urcu-mb.h - * * Userspace RCU header * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ #include #include +#include /* * See urcu/pointer.h and urcu/static/pointer.h for pointer * publication headers. */ #include +#include #ifdef __cplusplus extern "C" { @@ -90,6 +78,12 @@ extern int urcu_mb_read_ongoing(void); extern void urcu_mb_synchronize_rcu(void); +/* + * RCU grace period polling API. + */ +extern struct urcu_gp_poll_state urcu_mb_start_poll_synchronize_rcu(void); +extern bool urcu_mb_poll_state_synchronize_rcu(struct urcu_gp_poll_state state); + /* * Reader thread registration. */ diff --git a/include/urcu/urcu-memb.h b/include/urcu/urcu-memb.h index c11c93e..c89b4c0 100644 --- a/include/urcu/urcu-memb.h +++ b/include/urcu/urcu-memb.h @@ -1,44 +1,32 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_MEMB_H #define _URCU_MEMB_H /* - * urcu-memb.h - * * Userspace RCU header * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ #include #include +#include /* * See urcu/pointer.h and urcu/static/pointer.h for pointer * publication headers. */ #include +#include #ifdef __cplusplus extern "C" { @@ -90,6 +78,12 @@ extern int urcu_memb_read_ongoing(void); extern void urcu_memb_synchronize_rcu(void); +/* + * RCU grace period polling API. + */ +extern struct urcu_gp_poll_state urcu_memb_start_poll_synchronize_rcu(void); +extern bool urcu_memb_poll_state_synchronize_rcu(struct urcu_gp_poll_state state); + /* * Reader thread registration. */ diff --git a/include/urcu/urcu-poll.h b/include/urcu/urcu-poll.h new file mode 100644 index 0000000..c52d695 --- /dev/null +++ b/include/urcu/urcu-poll.h @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: 2023 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef _URCU_POLL_H +#define _URCU_POLL_H + +/* + * Userspace RCU polling header + */ + +struct urcu_gp_poll_state { + unsigned long grace_period_id; +}; + +#endif /* _URCU_POLL_H */ diff --git a/include/urcu/urcu-qsbr.h b/include/urcu/urcu-qsbr.h index fd6cbda..c2a3e19 100644 --- a/include/urcu/urcu-qsbr.h +++ b/include/urcu/urcu-qsbr.h @@ -1,9 +1,12 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_QSBR_H #define _URCU_QSBR_H /* - * urcu-qsbr.h - * * Userspace RCU QSBR header. * * LGPL-compatible code should include this header with : @@ -11,25 +14,12 @@ * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ #include #include +#include #include @@ -38,6 +28,7 @@ * publication headers. */ #include +#include #ifdef __cplusplus extern "C" { @@ -125,6 +116,12 @@ extern void urcu_qsbr_thread_online(void); extern void urcu_qsbr_synchronize_rcu(void); +/* + * RCU grace period polling API. + */ +extern struct urcu_gp_poll_state urcu_qsbr_start_poll_synchronize_rcu(void); +extern bool urcu_qsbr_poll_state_synchronize_rcu(struct urcu_gp_poll_state state); + /* * Reader thread registration. */ diff --git a/include/urcu/urcu-signal.h b/include/urcu/urcu-signal.h deleted file mode 100644 index 59c5d01..0000000 --- a/include/urcu/urcu-signal.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef _URCU_SIGNAL_H -#define _URCU_SIGNAL_H - -/* - * urcu-signal.h - * - * Userspace RCU header - * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * LGPL-compatible code should include this header with : - * - * #define _LGPL_SOURCE - * #include - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * IBM's contributions to this file may be relicensed under LGPLv2 or later. - */ - -#include -#include - -/* - * See urcu/pointer.h and urcu/static/pointer.h for pointer - * publication headers. - */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * Important ! - * - * Each thread containing read-side critical sections must be registered - * with rcu_register_thread_mb() before calling rcu_read_lock_mb(). - * rcu_unregister_thread_mb() should be called before the thread exits. - */ - -#ifdef _LGPL_SOURCE - -#include - -/* - * Mappings for static use of the userspace RCU library. - * Should only be used in LGPL-compatible code. - */ - -/* - * rcu_read_lock() - * rcu_read_unlock() - * - * Mark the beginning and end of a read-side critical section. - * DON'T FORGET TO USE RCU_REGISTER/UNREGISTER_THREAD() FOR EACH THREAD WITH - * READ-SIDE CRITICAL SECTION. - */ -#define urcu_signal_read_lock _urcu_signal_read_lock -#define urcu_signal_read_unlock _urcu_signal_read_unlock -#define urcu_signal_read_ongoing _urcu_signal_read_ongoing - -#else /* !_LGPL_SOURCE */ - -/* - * library wrappers to be used by non-LGPL compatible source code. - * See LGPL-only urcu/static/pointer.h for documentation. - */ - -extern void urcu_signal_read_lock(void); -extern void urcu_signal_read_unlock(void); -extern int urcu_signal_read_ongoing(void); - -#endif /* !_LGPL_SOURCE */ - -extern void urcu_signal_synchronize_rcu(void); - -/* - * Reader thread registration. - */ -extern void urcu_signal_register_thread(void); -extern void urcu_signal_unregister_thread(void); - -/* - * Explicit rcu initialization, for "early" use within library constructors. - */ -extern void urcu_signal_init(void); - -/* - * Q.S. reporting are no-ops for these URCU flavors. - */ -static inline void urcu_signal_quiescent_state(void) -{ -} - -static inline void urcu_signal_thread_offline(void) -{ -} - -static inline void urcu_signal_thread_online(void) -{ -} - -#ifdef __cplusplus -} -#endif - -#include -#include -#include - -#ifndef URCU_API_MAP -#include -#endif - -#endif /* _URCU_SIGNAL_H */ diff --git a/include/urcu/urcu.h b/include/urcu/urcu.h index 79cf590..4df48e4 100644 --- a/include/urcu/urcu.h +++ b/include/urcu/urcu.h @@ -1,44 +1,28 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_H #define _URCU_H /* - * urcu.h - * * Userspace RCU header * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * * LGPL-compatible code should include this header with : * * #define _LGPL_SOURCE * #include * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ -#if !defined(RCU_MEMBARRIER) && !defined(RCU_SIGNAL) && !defined(RCU_MB) +#if !defined(RCU_MEMBARRIER) && !defined(RCU_MB) #define RCU_MEMBARRIER #endif #ifdef RCU_MEMBARRIER #include -#elif defined(RCU_SIGNAL) -#include #elif defined(RCU_MB) #include #else diff --git a/include/urcu/urcu_ref.h b/include/urcu/urcu_ref.h index 5579ca6..916a9df 100644 --- a/include/urcu/urcu_ref.h +++ b/include/urcu/urcu_ref.h @@ -1,2 +1,6 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #warning "urcu/urcu_ref.h is deprecated. Please include urcu/ref.h instead." #include diff --git a/include/urcu/wfcqueue.h b/include/urcu/wfcqueue.h index bd920ca..bba5c55 100644 --- a/include/urcu/wfcqueue.h +++ b/include/urcu/wfcqueue.h @@ -1,27 +1,13 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011-2012 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFCQUEUE_H #define _URCU_WFCQUEUE_H /* - * urcu/wfcqueue.h - * * Userspace RCU library - Concurrent Queue with Wait-Free Enqueue/Blocking Dequeue - * - * Copyright 2010-2012 - Mathieu Desnoyers - * Copyright 2011-2012 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/wfqueue.h b/include/urcu/wfqueue.h index 214d3bf..45506ea 100644 --- a/include/urcu/wfqueue.h +++ b/include/urcu/wfqueue.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFQUEUE_H #define _URCU_WFQUEUE_H /* - * wfqueue.h - * * Userspace RCU library - Queue with Wait-Free Enqueue/Blocking Dequeue - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/include/urcu/wfstack.h b/include/urcu/wfstack.h index 0890f5c..38e5b6b 100644 --- a/include/urcu/wfstack.h +++ b/include/urcu/wfstack.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WFSTACK_H #define _URCU_WFSTACK_H /* - * urcu/wfstack.h - * * Userspace RCU library - Stack with wait-free push, blocking traversal. - * - * Copyright 2010-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/lgpl-2.1.txt b/lgpl-2.1.txt deleted file mode 100644 index 602bfc9..0000000 --- a/lgpl-2.1.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/lgpl-relicensing.md b/lgpl-relicensing.md new file mode 100644 index 0000000..10e7832 --- /dev/null +++ b/lgpl-relicensing.md @@ -0,0 +1,37 @@ + + +# Userspace-RCU LGPL 2.1+ re-licensing + +Mathieu Desnoyers +May 13th, 2009 + +IBM Corporation allowed LGPLv2.1+ licensing of their contribution to the +userspace RCU library in a patch submitted on May 8, 2009 from Paul E. +McKenney and reviewed by Steven L. Bennett: + + https://lists.lttng.org/pipermail/lttng-dev/2009-May/012835.html + +I (Mathieu Desnoyers) re-implemented ACCESS_ONCE(), likely(), unlikely() and +barrier() from scratch without reference to the original code. + + commit id : 2dc5fa0f7cfbfb0a64a7a67b39626650e863f16a + +Bert Wesarg approved LGPL re-licensing of his +patch in an email dated May 13, 2009 : + + http://lkml.org/lkml/2009/5/13/16 + +xchg() primitives has been rewritten from a MIT-licensed cmpxchg for Intel +and powerpc. They are MIT-licensed and therefore usable in LGPL code. +This cmpxchg code was obtained from the atomic_ops project: + + http://www.hpl.hp.com/research/linux/atomic_ops/ + +I (Mathieu Desnoyers) wrote the remainder of the code. + +The license for the library files in this project was therefore changed to +LGPLv2.1 on May 13, 2009, as detailed in LICENSE. diff --git a/lgpl-relicensing.txt b/lgpl-relicensing.txt deleted file mode 100644 index 3e47d3f..0000000 --- a/lgpl-relicensing.txt +++ /dev/null @@ -1,29 +0,0 @@ -Mathieu Desnoyers -May 13th, 2009 - -IBM Corporation allowed LGPLv2.1+ licensing of their contribution to the -userspace RCU library in a patch submitted on May 8, 2009 from Paul E. -McKenney and reviewed by Steven L. Bennett: - - https://lists.lttng.org/pipermail/lttng-dev/2009-May/012835.html - -I (Mathieu Desnoyers) re-implemented ACCESS_ONCE(), likely(), unlikely() and -barrier() from scratch without reference to the original code. - - commit id : 2dc5fa0f7cfbfb0a64a7a67b39626650e863f16a - -Bert Wesarg approved LGPL relicensing of his -patch in an email dated May 13, 2009 : - - http://lkml.org/lkml/2009/5/13/16 - -xchg() primitives has been rewritten from a MIT-licensed cmpxchg for Intel -and powerpc. They are MIT-licensed and therefore usable in LGPL code. -This cmpxchg code was obtained from the atomic_ops project: - - http://www.hpl.hp.com/research/linux/atomic_ops/ - -I (Mathieu Desnoyers) wrote the remainder of the code. - -The license for the library files in this project was therefore changed to -LGPLv2.1 on May 13, 2009, as detailed in LICENSE. diff --git a/m4/ae_cc_atomic_builtins.m4 b/m4/ae_cc_atomic_builtins.m4 new file mode 100644 index 0000000..0bdb8d0 --- /dev/null +++ b/m4/ae_cc_atomic_builtins.m4 @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro +# SPDX-FileCopyrightText: 2023 Michael Jeanson +# +# SYNOPSIS +# +# AE_CC_ATOMIC_BUILTINS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# + +#serial 1 + +AC_DEFUN([AE_CC_ATOMIC_BUILTINS], [ +AC_REQUIRE([AC_PROG_CC]) +AC_LANG_PUSH([C]) + +AC_CACHE_CHECK( + [whether $CC supports atomic builtins], + [ae_cv_cc_atomic_builtins], + [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ + int x, y; + ],[ + __atomic_store_n(&x, 0, __ATOMIC_RELAXED); + __atomic_load_n(&x, __ATOMIC_RELAXED); + y = __atomic_exchange_n(&x, 1, __ATOMIC_RELAXED); + __atomic_compare_exchange_n(&x, &y, 0, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); + __atomic_add_fetch(&x, 1, __ATOMIC_RELAXED); + __atomic_sub_fetch(&x, 1, __ATOMIC_RELAXED); + __atomic_and_fetch(&x, 0x01, __ATOMIC_RELAXED); + __atomic_or_fetch(&x, 0x01, __ATOMIC_RELAXED); + __atomic_thread_fence(__ATOMIC_RELAXED); + __atomic_signal_fence(__ATOMIC_RELAXED); + ]) + ],[ + ae_cv_cc_atomic_builtins=yes + ],[ + ae_cv_cc_atomic_builtins=no + ]) + ] +) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ae_cv_cc_atomic_builtins" = "xyes"; then + $1 + : +else + $2 + : +fi + +AC_LANG_POP +])dnl AE_CC_ATOMIC_BUILTINS diff --git a/m4/ae_config_feature.m4 b/m4/ae_config_feature.m4 index 1d7cd58..d34f5b5 100644 --- a/m4/ae_config_feature.m4 +++ b/m4/ae_config_feature.m4 @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Michael Jeanson +# SPDX-FileCopyrightText: 2008 Francesco Salvestrini +# +# SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro # # SYNOPSIS # @@ -63,39 +67,8 @@ # NOTE: AE_FEATURE_ENABLE/DISABLE() must be placed first of the relative # AE_FEATURE() macro if you want the the proper ACTION-IF-ENABLED and # ACTION-IF-NOT-ENABLED to run. -# -# LICENSE -# -# Copyright (c) 2020 Michael Jeanson -# Copyright (c) 2008 Francesco Salvestrini -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. -#serial 2 +#serial 3 # AE_FEATURE_DEFAULT_ENABLE: The next feature defined with AE_FEATURE will diff --git a/m4/ae_pprint.m4 b/m4/ae_pprint.m4 new file mode 100644 index 0000000..029ff99 --- /dev/null +++ b/m4/ae_pprint.m4 @@ -0,0 +1,210 @@ +# SPDX-FileCopyrightText: 2016 Philippe Proulx +# +# SPDX-License-Identifier: GPL-2.0-or-later WITH Autoconf-exception-2.0 + +#serial 2 + +# AE_PPRINT_INIT(): initializes the pretty printing system. +# +# Use this macro before using any other AE_PPRINT_* macro. +AC_DEFUN([AE_PPRINT_INIT], [ + m4_define([AE_PPRINT_CONFIG_TS], [50]) + m4_define([AE_PPRINT_CONFIG_INDENT], [2]) + AE_PPRINT_YES_MSG=yes + AE_PPRINT_NO_MSG=no + + # find tput, which tells us if colors are supported and gives us color codes + AC_PATH_PROG([ae_pprint_tput], [tput]) + + AS_IF([test -n "$ae_pprint_tput"], [ + AS_IF([test -n "$PS1" && test `"$ae_pprint_tput" colors` -eq 256 && test -t 1], [ + # interactive shell and colors supported and standard output + # file descriptor is opened on a terminal + AE_PPRINT_COLOR_TXTBLK="`"$ae_pprint_tput" setaf 0`" + AE_PPRINT_COLOR_TXTBLU="`"$ae_pprint_tput" setaf 4`" + AE_PPRINT_COLOR_TXTGRN="`"$ae_pprint_tput" setaf 2`" + AE_PPRINT_COLOR_TXTCYN="`"$ae_pprint_tput" setaf 6`" + AE_PPRINT_COLOR_TXTRED="`"$ae_pprint_tput" setaf 1`" + AE_PPRINT_COLOR_TXTPUR="`"$ae_pprint_tput" setaf 5`" + AE_PPRINT_COLOR_TXTYLW="`"$ae_pprint_tput" setaf 3`" + AE_PPRINT_COLOR_TXTWHT="`"$ae_pprint_tput" setaf 7`" + AE_PPRINT_COLOR_BLD=`"$ae_pprint_tput" bold` + AE_PPRINT_COLOR_BLDBLK="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTBLK" + AE_PPRINT_COLOR_BLDBLU="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTBLU" + AE_PPRINT_COLOR_BLDGRN="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTGRN" + AE_PPRINT_COLOR_BLDCYN="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTCYN" + AE_PPRINT_COLOR_BLDRED="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTRED" + AE_PPRINT_COLOR_BLDPUR="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTPUR" + AE_PPRINT_COLOR_BLDYLW="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTYLW" + AE_PPRINT_COLOR_BLDWHT="$AE_PPRINT_COLOR_BLD$AE_PPRINT_COLOR_TXTWHT" + AE_PPRINT_COLOR_RST="`"$ae_pprint_tput" sgr0`" + + # colored yes and no + AE_PPRINT_YES_MSG="$AE_PPRINT_COLOR_BLDGRN$AE_PPRINT_YES_MSG$AE_PPRINT_COLOR_RST" + AE_PPRINT_NO_MSG="$AE_PPRINT_COLOR_BLDRED$AE_PPRINT_NO_MSG$AE_PPRINT_COLOR_RST" + + # subtitle color + AE_PPRINT_COLOR_SUBTITLE="$AE_PPRINT_COLOR_BLDCYN" + ]) + ]) +]) + +# AE_PPRINT_SET_INDENT(indent): sets the current indentation. +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_SET_INDENT], [ + m4_define([AE_PPRINT_CONFIG_INDENT], [$1]) +]) + +# AE_PPRINT_SET_TS(ts): sets the current tab stop. +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_SET_TS], [ + m4_define([AE_PPRINT_CONFIG_TS], [$1]) +]) + +# AE_PPRINT_SUBTITLE(subtitle): pretty prints a subtitle. +# +# The subtitle is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_SUBTITLE], [ + AS_ECHO(["${AE_PPRINT_COLOR_SUBTITLE}$1$AE_PPRINT_COLOR_RST"]) +]) + +AC_DEFUN([_AE_PPRINT_INDENT], [ + m4_if(AE_PPRINT_CONFIG_INDENT, 0, [ + ], [ + m4_for([ae_pprint_i], [0], m4_eval(AE_PPRINT_CONFIG_INDENT * 2 - 1), [1], [ + AS_ECHO_N([" "]) + ]) + ]) +]) + +# AE_PPRINT_PROP_STRING(title, value, title_color?): pretty prints a +# string property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The $AE_PPRINT_CONFIG_INDENT variable must be set to the desired indentation +# level. +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_PROP_STRING], [ + m4_pushdef([ae_pprint_title], [$1]) + m4_pushdef([ae_pprint_value], [$2]) + m4_pushdef([ae_pprint_title_color], m4_default([$3], [])) + m4_pushdef([ae_pprint_title_len], m4_len(ae_pprint_title)) + m4_pushdef([ae_pprint_spaces_cnt], m4_eval(AE_PPRINT_CONFIG_TS - ae_pprint_title_len - (AE_PPRINT_CONFIG_INDENT * 2) - 1)) + + m4_if(m4_eval(ae_pprint_spaces_cnt <= 0), [1], [ + m4_define([ae_pprint_spaces_cnt], [1]) + ]) + + m4_pushdef([ae_pprint_spaces], []) + + m4_for([ae_pprint_i], 0, m4_eval(ae_pprint_spaces_cnt - 1), [1], [ + m4_append([ae_pprint_spaces], [ ]) + ]) + + _AE_PPRINT_INDENT + + AS_ECHO_N(["ae_pprint_title_color""ae_pprint_title$AE_PPRINT_COLOR_RST:ae_pprint_spaces"]) + AS_ECHO(["${AE_PPRINT_COLOR_BLD}ae_pprint_value$AE_PPRINT_COLOR_RST"]) + + m4_popdef([ae_pprint_spaces]) + m4_popdef([ae_pprint_spaces_cnt]) + m4_popdef([ae_pprint_title_len]) + m4_popdef([ae_pprint_title_color]) + m4_popdef([ae_pprint_value]) + m4_popdef([ae_pprint_title]) +]) + +# AE_PPRINT_PROP_BOOL(title, value, title_color?): pretty prints a boolean +# property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The value is evaluated at shell runtime. Its evaluation must be +# 0 (false) or 1 (true). +# +# Uses the AE_PPRINT_PROP_STRING() with the "yes" or "no" string. +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_PROP_BOOL], [ + m4_pushdef([ae_pprint_title], [$1]) + m4_pushdef([ae_pprint_value], [$2]) + + test ae_pprint_value -eq 0 && ae_pprint_msg="$AE_PPRINT_NO_MSG" || ae_pprint_msg="$AE_PPRINT_YES_MSG" + + m4_if([$#], [3], [ + AE_PPRINT_PROP_STRING(ae_pprint_title, [$ae_pprint_msg], $3) + ], [ + AE_PPRINT_PROP_STRING(ae_pprint_title, [$ae_pprint_msg]) + ]) + + m4_popdef([ae_pprint_value]) + m4_popdef([ae_pprint_title]) +]) + +# AE_PPRINT_PROP_BOOL_CUSTOM(title, value, no_msg, title_color?): pretty prints a boolean +# property. +# +# The title is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# The value is evaluated at shell runtime. Its evaluation must be +# 0 (false) or 1 (true). +# +# Uses the AE_PPRINT_PROP_STRING() with the "yes" or "no" string. +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_PROP_BOOL_CUSTOM], [ + m4_pushdef([ae_pprint_title], [$1]) + m4_pushdef([ae_pprint_value], [$2]) + m4_pushdef([ae_pprint_value_no_msg], [$3]) + + test ae_pprint_value -eq 0 && ae_pprint_msg="$AE_PPRINT_NO_MSG (ae_pprint_value_no_msg)" || ae_pprint_msg="$AE_PPRINT_YES_MSG" + + m4_if([$#], [4], [ + AE_PPRINT_PROP_STRING(ae_pprint_title, [$ae_pprint_msg], $4) + ], [ + AE_PPRINT_PROP_STRING(ae_pprint_title, [$ae_pprint_msg]) + ]) + + m4_popdef([ae_pprint_value_no_msg]) + m4_popdef([ae_pprint_value]) + m4_popdef([ae_pprint_title]) +]) + +# AE_PPRINT_WARN(msg): pretty prints a warning message. +# +# The message is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_WARN], [ + m4_pushdef([ae_pprint_msg], [$1]) + + _AE_PPRINT_INDENT + AS_ECHO(["${AE_PPRINT_COLOR_TXTYLW}WARNING:$AE_PPRINT_COLOR_RST ${AE_PPRINT_COLOR_BLDYLW}ae_pprint_msg$AE_PPRINT_COLOR_RST"]) + + m4_popdef([ae_pprint_msg]) +]) + +# AE_PPRINT_ERROR(msg): pretty prints an error message and exits. +# +# The message is put as is in a double-quoted shell string so the user +# needs to escape ". +# +# Use AE_PPRINT_INIT() before using this macro. +AC_DEFUN([AE_PPRINT_ERROR], [ + m4_pushdef([ae_pprint_msg], [$1]) + + AC_MSG_ERROR([${AE_PPRINT_COLOR_BLDRED}ae_pprint_msg$AE_PPRINT_COLOR_RST]) + + m4_popdef([ae_pprint_msg]) +]) diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 index 9c85635..29d86e0 100644 --- a/m4/ax_append_compile_flags.m4 +++ b/m4/ax_append_compile_flags.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: FSFAP # ============================================================================ # https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # ============================================================================ diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 index dd6d8b6..e1ea0fc 100644 --- a/m4/ax_append_flag.m4 +++ b/m4/ax_append_flag.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: FSFAP # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4 index 6a1ede1..98999e1 100644 --- a/m4/ax_c___attribute__.m4 +++ b/m4/ax_c___attribute__.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html # =========================================================================== diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index bd753b3..8f62565 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: FSFAP # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index 9413da6..c081ffa 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: FSFAP # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== @@ -10,8 +11,8 @@ # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) -# or '14' (for the C++14 standard). +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. @@ -36,13 +37,14 @@ # Copyright (c) 2016, 2018 Krzesimir Nowak # Copyright (c) 2019 Enji Cooper # Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 12 +#serial 18 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -51,6 +53,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -102,9 +105,18 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide + dnl with -std=c++17. We suffix the cache variable name with _MSVC to + dnl avoid this. + switch=-std:c++${alternative} + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) + else + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + fi AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" @@ -151,7 +163,6 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) - dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], @@ -159,12 +170,24 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) +dnl Test body for checking C++17 support + m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ) +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + + dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ @@ -176,7 +199,11 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -467,7 +494,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -591,7 +618,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif __cplusplus < 201703L && !defined _MSC_VER #error "This is not a C++17 compiler" @@ -957,6 +984,36 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus < 201703L +#endif // __cplusplus < 201703L && !defined _MSC_VER + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER ]]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 507f182..db15ab9 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Autoconf-exception-macro # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== @@ -14,20 +15,24 @@ # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to @@ -83,7 +88,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 27 +#serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -105,6 +110,7 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) @@ -482,18 +488,28 @@ if test "x$ax_pthread_ok" = "xyes"; then [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4 index 17c3eab..6de1b2a 100644 --- a/m4/ax_require_defined.m4 +++ b/m4/ax_require_defined.m4 @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: FSFAP # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== diff --git a/m4/pprint.m4 b/m4/pprint.m4 deleted file mode 100644 index a7cfd94..0000000 --- a/m4/pprint.m4 +++ /dev/null @@ -1,210 +0,0 @@ -# Pretty printing macros. -# -# Author: Philippe Proulx - -#serial 1 - -# PPRINT_INIT(): initializes the pretty printing system. -# -# Use this macro before using any other PPRINT_* macro. -AC_DEFUN([PPRINT_INIT], [ - m4_define([PPRINT_CONFIG_TS], [50]) - m4_define([PPRINT_CONFIG_INDENT], [2]) - PPRINT_YES_MSG=yes - PPRINT_NO_MSG=no - - # find tput, which tells us if colors are supported and gives us color codes - AC_PATH_PROG([pprint_tput], [tput]) - - AS_IF([test -n "$pprint_tput"], [ - AS_IF([test -n "$PS1" && test `"$pprint_tput" colors` -eq 256 && test -t 1], [ - # interactive shell and colors supported and standard output - # file descriptor is opened on a terminal - PPRINT_COLOR_TXTBLK="`"$pprint_tput" setaf 0`" - PPRINT_COLOR_TXTBLU="`"$pprint_tput" setaf 4`" - PPRINT_COLOR_TXTGRN="`"$pprint_tput" setaf 2`" - PPRINT_COLOR_TXTCYN="`"$pprint_tput" setaf 6`" - PPRINT_COLOR_TXTRED="`"$pprint_tput" setaf 1`" - PPRINT_COLOR_TXTPUR="`"$pprint_tput" setaf 5`" - PPRINT_COLOR_TXTYLW="`"$pprint_tput" setaf 3`" - PPRINT_COLOR_TXTWHT="`"$pprint_tput" setaf 7`" - PPRINT_COLOR_BLD=`"$pprint_tput" bold` - PPRINT_COLOR_BLDBLK="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTBLK" - PPRINT_COLOR_BLDBLU="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTBLU" - PPRINT_COLOR_BLDGRN="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTGRN" - PPRINT_COLOR_BLDCYN="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTCYN" - PPRINT_COLOR_BLDRED="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTRED" - PPRINT_COLOR_BLDPUR="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTPUR" - PPRINT_COLOR_BLDYLW="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTYLW" - PPRINT_COLOR_BLDWHT="$PPRINT_COLOR_BLD$PPRINT_COLOR_TXTWHT" - PPRINT_COLOR_RST="`"$pprint_tput" sgr0`" - - # colored yes and no - PPRINT_YES_MSG="$PPRINT_COLOR_BLDGRN$PPRINT_YES_MSG$PPRINT_COLOR_RST" - PPRINT_NO_MSG="$PPRINT_COLOR_BLDRED$PPRINT_NO_MSG$PPRINT_COLOR_RST" - - # subtitle color - PPRINT_COLOR_SUBTITLE="$PPRINT_COLOR_BLDCYN" - ]) - ]) -]) - -# PPRINT_SET_INDENT(indent): sets the current indentation. -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_SET_INDENT], [ - m4_define([PPRINT_CONFIG_INDENT], [$1]) -]) - -# PPRINT_SET_TS(ts): sets the current tab stop. -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_SET_TS], [ - m4_define([PPRINT_CONFIG_TS], [$1]) -]) - -# PPRINT_SUBTITLE(subtitle): pretty prints a subtitle. -# -# The subtitle is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_SUBTITLE], [ - AS_ECHO(["${PPRINT_COLOR_SUBTITLE}$1$PPRINT_COLOR_RST"]) -]) - -AC_DEFUN([_PPRINT_INDENT], [ - m4_if(PPRINT_CONFIG_INDENT, 0, [ - ], [ - m4_for([pprint_i], [0], m4_eval(PPRINT_CONFIG_INDENT * 2 - 1), [1], [ - AS_ECHO_N([" "]) - ]) - ]) -]) - -# PPRINT_PROP_STRING(title, value, title_color?): pretty prints a -# string property. -# -# The title is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# The $PPRINT_CONFIG_INDENT variable must be set to the desired indentation -# level. -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_PROP_STRING], [ - m4_pushdef([pprint_title], [$1]) - m4_pushdef([pprint_value], [$2]) - m4_pushdef([pprint_title_color], m4_default([$3], [])) - m4_pushdef([pprint_title_len], m4_len(pprint_title)) - m4_pushdef([pprint_spaces_cnt], m4_eval(PPRINT_CONFIG_TS - pprint_title_len - (PPRINT_CONFIG_INDENT * 2) - 1)) - - m4_if(m4_eval(pprint_spaces_cnt <= 0), [1], [ - m4_define([pprint_spaces_cnt], [1]) - ]) - - m4_pushdef([pprint_spaces], []) - - m4_for([pprint_i], 0, m4_eval(pprint_spaces_cnt - 1), [1], [ - m4_append([pprint_spaces], [ ]) - ]) - - _PPRINT_INDENT - - AS_ECHO_N(["pprint_title_color""pprint_title$PPRINT_COLOR_RST:pprint_spaces"]) - AS_ECHO(["${PPRINT_COLOR_BLD}pprint_value$PPRINT_COLOR_RST"]) - - m4_popdef([pprint_spaces]) - m4_popdef([pprint_spaces_cnt]) - m4_popdef([pprint_title_len]) - m4_popdef([pprint_title_color]) - m4_popdef([pprint_value]) - m4_popdef([pprint_title]) -]) - -# PPRINT_PROP_BOOL(title, value, title_color?): pretty prints a boolean -# property. -# -# The title is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# The value is evaluated at shell runtime. Its evaluation must be -# 0 (false) or 1 (true). -# -# Uses the PPRINT_PROP_STRING() with the "yes" or "no" string. -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_PROP_BOOL], [ - m4_pushdef([pprint_title], [$1]) - m4_pushdef([pprint_value], [$2]) - - test pprint_value -eq 0 && pprint_msg="$PPRINT_NO_MSG" || pprint_msg="$PPRINT_YES_MSG" - - m4_if([$#], [3], [ - PPRINT_PROP_STRING(pprint_title, [$pprint_msg], $3) - ], [ - PPRINT_PROP_STRING(pprint_title, [$pprint_msg]) - ]) - - m4_popdef([pprint_value]) - m4_popdef([pprint_title]) -]) - -# PPRINT_PROP_BOOL_CUSTOM(title, value, no_msg, title_color?): pretty prints a boolean -# property. -# -# The title is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# The value is evaluated at shell runtime. Its evaluation must be -# 0 (false) or 1 (true). -# -# Uses the PPRINT_PROP_STRING() with the "yes" or "no" string. -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_PROP_BOOL_CUSTOM], [ - m4_pushdef([pprint_title], [$1]) - m4_pushdef([pprint_value], [$2]) - m4_pushdef([pprint_value_no_msg], [$3]) - - test pprint_value -eq 0 && pprint_msg="$PPRINT_NO_MSG (pprint_value_no_msg)" || pprint_msg="$PPRINT_YES_MSG" - - m4_if([$#], [4], [ - PPRINT_PROP_STRING(pprint_title, [$pprint_msg], $4) - ], [ - PPRINT_PROP_STRING(pprint_title, [$pprint_msg]) - ]) - - m4_popdef([pprint_value_no_msg]) - m4_popdef([pprint_value]) - m4_popdef([pprint_title]) -]) - -# PPRINT_WARN(msg): pretty prints a warning message. -# -# The message is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_WARN], [ - m4_pushdef([pprint_msg], [$1]) - - _PPRINT_INDENT - AS_ECHO(["${PPRINT_COLOR_TXTYLW}WARNING:$PPRINT_COLOR_RST ${PPRINT_COLOR_BLDYLW}pprint_msg$PPRINT_COLOR_RST"]) - - m4_popdef([pprint_msg]) -]) - -# PPRINT_ERROR(msg): pretty prints an error message and exits. -# -# The message is put as is in a double-quoted shell string so the user -# needs to escape ". -# -# Use PPRINT_INIT() before using this macro. -AC_DEFUN([PPRINT_ERROR], [ - m4_pushdef([pprint_msg], [$1]) - - AC_MSG_ERROR([${PPRINT_COLOR_BLDRED}pprint_msg$PPRINT_COLOR_RST]) - - m4_popdef([pprint_msg]) -]) diff --git a/scripts/urcu-api-list.sh b/scripts/urcu-api-list.sh index 3d15048..3f065b4 100755 --- a/scripts/urcu-api-list.sh +++ b/scripts/urcu-api-list.sh @@ -1,25 +1,13 @@ #!/bin/sh + +# SPDX-FileCopyrightText: 2013 IBM Corporation # +# SPDX-License-Identifier: GPL-2.0-or-later + # Run in userspace-rcu git archive. Prints out a list of API members # and the version in which they were introduced. You need to list all # the API members immediately below. Depends on "cscope". -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# Copyright (C) IBM Corporation, 2013 -# + # Authors: Paul E. McKenney api="caa_container_of \ diff --git a/src/Makefile.am b/src/Makefile.am index 6c38353..b555c81 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + AM_CPPFLAGS += -I$(top_srcdir)/src #Add the -version-info directly here since we are only building @@ -5,7 +9,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION) $(LT_NO_UNDEFINED) dist_noinst_HEADERS = urcu-die.h urcu-wait.h compat-getcpu.h \ - compat-rand.h urcu-utils.h + urcu-utils.h compat-smp.h COMPAT = compat_arch.c compat_futex.c @@ -14,7 +18,7 @@ RCULFHASH = rculfhash.c rculfhash-mm-order.c rculfhash-mm-chunk.c \ lib_LTLIBRARIES = liburcu-common.la \ liburcu.la liburcu-qsbr.la \ - liburcu-mb.la liburcu-signal.la liburcu-bp.la \ + liburcu-mb.la liburcu-bp.la \ liburcu-memb.la liburcu-cds.la # @@ -39,10 +43,6 @@ liburcu_mb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) liburcu_mb_la_CFLAGS = -DRCU_MB $(AM_CFLAGS) liburcu_mb_la_LIBADD = liburcu-common.la -liburcu_signal_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) -liburcu_signal_la_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) -liburcu_signal_la_LIBADD = liburcu-common.la - liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT) liburcu_bp_la_LIBADD = liburcu-common.la @@ -52,9 +52,10 @@ liburcu_cds_la_LIBADD = liburcu-common.la pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = liburcu-cds.pc liburcu.pc liburcu-bp.pc liburcu-qsbr.pc \ - liburcu-signal.pc liburcu-mb.pc liburcu-memb.pc + liburcu-mb.pc liburcu-memb.pc EXTRA_DIST = \ urcu-call-rcu-impl.h \ urcu-defer-impl.h \ + urcu-poll-impl.h \ rculfhash-internal.h diff --git a/src/compat-getcpu.h b/src/compat-getcpu.h index 3c1899b..ad5ec11 100644 --- a/src/compat-getcpu.h +++ b/src/compat-getcpu.h @@ -1,26 +1,10 @@ +// SPDX-FileCopyrightText: 2015 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _COMPAT_GETCPU_H #define _COMPAT_GETCPU_H -/* - * compat-getcpu.h - * - * Copyright (c) 2015 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - #if defined(HAVE_SCHED_GETCPU) #include diff --git a/src/compat-rand.h b/src/compat-rand.h deleted file mode 100644 index 835d99b..0000000 --- a/src/compat-rand.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _COMPAT_RAND_H -#define _COMPAT_RAND_H - -/* - * compat-rand.h - * - * Userspace RCU library - rand/rand_r Compatibility Header - * - * Copyright 1996 - Ulrich Drepper - * Copyright 2013 - Pierre-Luc St-Charles - * - * Note: this file is only used to simplify the code required to - * use the 'rand_r(...)' system function across multiple platforms, - * which might not always be referenced the same way. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef HAVE_RAND_R -/* - * Reentrant random function from POSIX.1c. - * Copyright (C) 1996, 1999 Free Software Foundation, Inc. - * This file is part of the GNU C Library. - * Contributed by Ulrich Drepper >, 1996. - */ -static inline int rand_r(unsigned int *seed) -{ - unsigned int next = *seed; - int result; - - next *= 1103515245; - next += 12345; - result = (unsigned int) (next / 65536) % 2048; - - next *= 1103515245; - next += 12345; - result <<= 10; - result ^= (unsigned int) (next / 65536) % 1024; - - next *= 1103515245; - next += 12345; - result <<= 10; - result ^= (unsigned int) (next / 65536) % 1024; - - *seed = next; - - return result; -} -#endif /* HAVE_RAND_R */ - -#endif /* _COMPAT_RAND_H */ diff --git a/src/compat-smp.h b/src/compat-smp.h new file mode 100644 index 0000000..31fa979 --- /dev/null +++ b/src/compat-smp.h @@ -0,0 +1,275 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2011-2012 Mathieu Desnoyers + * Copyright (C) 2019 Michael Jeanson + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define URCU_CPUMASK_SIZE 4096 + +#if defined(HAVE_SYSCONF) +static inline int get_num_possible_cpus_sysconf(void) +{ + return sysconf(_SC_NPROCESSORS_CONF); +} +#else +/* + * On platforms without sysconf(), always return -1. + */ +static inline int get_num_possible_cpus_sysconf(void) +{ + return -1; +} +#endif + +#ifdef __linux__ +/* + * Get the highest CPU id from sysfs. + * + * Iterate on all the folders in "/sys/devices/system/cpu" that start with + * "cpu" followed by an integer, keep the highest CPU id encountered during + * this iteration and add 1 to get a number of CPUs. + * + * Returns the highest CPU id, or -1 on error. + */ +static inline int _get_max_cpuid_from_sysfs(const char *path) +{ + long max_cpuid = -1; + + DIR *cpudir; + struct dirent *entry; + + assert(path); + + cpudir = opendir(path); + if (cpudir == NULL) + goto end; + + /* + * Iterate on all directories named "cpu" followed by an integer. + */ + while ((entry = readdir(cpudir))) { + if (entry->d_type == DT_DIR && + strncmp(entry->d_name, "cpu", 3) == 0) { + + char *endptr; + long cpu_id; + + cpu_id = strtol(entry->d_name + 3, &endptr, 10); + if ((cpu_id < LONG_MAX) && (endptr != entry->d_name + 3) + && (*endptr == '\0')) { + if (cpu_id > max_cpuid) + max_cpuid = cpu_id; + } + } + } + + if (closedir(cpudir)) + perror("closedir"); + + /* + * If the max CPU id is out of bound, set it to -1 so it results in a + * CPU num of 0. + */ + if (max_cpuid < 0 || max_cpuid > INT_MAX) + max_cpuid = -1; + +end: + return max_cpuid; +} + +static inline int get_max_cpuid_from_sysfs(void) +{ + return _get_max_cpuid_from_sysfs("/sys/devices/system/cpu"); +} + + +/* + * As a fallback to parsing the CPU mask in "/sys/devices/system/cpu/possible", + * iterate on all the folders in "/sys/devices/system/cpu" that start with + * "cpu" followed by an integer, keep the highest CPU id encountered during + * this iteration and add 1 to get a number of CPUs. + * + * Then get the value from sysconf(_SC_NPROCESSORS_CONF) as a fallback and + * return the highest one. + * + * On Linux, using the value from sysconf can be unreliable since the way it + * counts CPUs varies between C libraries and even between versions of the same + * library. If we used it directly, getcpu() could return a value greater than + * this sysconf, in which case the arrays indexed by processor would overflow. + * + * As another example, the MUSL libc implementation of the _SC_NPROCESSORS_CONF + * sysconf does not return the number of configured CPUs in the system but + * relies on the cpu affinity mask of the current task. + * + * Returns 0 or less on error. + */ +static inline int get_num_possible_cpus_fallback(void) +{ + /* + * Get the sysconf value as a last resort. Keep the highest number. + */ + return caa_max(get_num_possible_cpus_sysconf(), get_max_cpuid_from_sysfs() + 1); +} + +/* + * Get a CPU mask string from sysfs. + * + * buf: the buffer where the mask will be read. + * max_bytes: the maximum number of bytes to write in the buffer. + * path: file path to read the mask from. + * + * Returns the number of bytes read or -1 on error. + */ +static inline int get_cpu_mask_from_sysfs(char *buf, size_t max_bytes, const char *path) +{ + ssize_t bytes_read = 0; + size_t total_bytes_read = 0; + int fd = -1, ret = -1; + + assert(path); + + if (buf == NULL) + goto end; + + fd = open(path, O_RDONLY); + if (fd < 0) + goto end; + + do { + bytes_read = read(fd, buf + total_bytes_read, + max_bytes - total_bytes_read); + + if (bytes_read < 0) { + if (errno == EINTR) { + continue; /* retry operation */ + } else { + goto end; + } + } + + total_bytes_read += bytes_read; + assert(total_bytes_read <= max_bytes); + } while (max_bytes > total_bytes_read && bytes_read > 0); + + /* + * Make sure the mask read is a null terminated string. + */ + if (total_bytes_read < max_bytes) + buf[total_bytes_read] = '\0'; + else + buf[max_bytes - 1] = '\0'; + + if (total_bytes_read > INT_MAX) + goto end; + + ret = (int) total_bytes_read; + +end: + if (fd >= 0 && close(fd) < 0) + perror("close"); + + return ret; +} + +/* + * Get the CPU possible mask string from sysfs. + * + * buf: the buffer where the mask will be read. + * max_bytes: the maximum number of bytes to write in the buffer. + * + * Returns the number of bytes read or -1 on error. + */ +static inline int get_possible_cpu_mask_from_sysfs(char *buf, size_t max_bytes) +{ + return get_cpu_mask_from_sysfs(buf, max_bytes, + "/sys/devices/system/cpu/possible"); +} + +/* + * Get the highest CPU id from the possible CPU mask. + * + * pmask: the mask to parse. + * len: the len of the mask excluding '\0'. + * + * Returns the highest CPU id from the mask or -1 on error. + */ +static inline int get_max_cpuid_from_mask(const char *pmask, size_t len) +{ + ssize_t i; + unsigned long cpu_index; + char *endptr; + + /* We need at least one char to read */ + if (len < 1) + goto error; + + /* Start from the end to read the last CPU index. */ + for (i = len - 1; i > 0; i--) { + /* Break when we hit the first separator. */ + if ((pmask[i] == ',') || (pmask[i] == '-')) { + i++; + break; + } + } + + cpu_index = strtoul(&pmask[i], &endptr, 10); + + if ((&pmask[i] != endptr) && (cpu_index < INT_MAX)) + return (int) cpu_index; + +error: + return -1; +} + +/* + * On Linux try sysfs first and fallback to sysconf. + */ +static inline int get_possible_cpus_array_len(void) +{ + int ret; + char buf[URCU_CPUMASK_SIZE]; + + /* Get the possible cpu mask from sysfs, fallback to sysconf. */ + ret = get_possible_cpu_mask_from_sysfs((char *) &buf, URCU_CPUMASK_SIZE); + if (ret <= 0) + goto fallback; + + /* Parse the possible cpu mask, on failure fallback to sysconf. */ + ret = get_max_cpuid_from_mask((char *) &buf, ret); + if (ret >= 0) { + /* Add 1 to convert from max cpuid to an array len. */ + ret++; + goto end; + } + +fallback: + /* Fallback to sysconf. */ + ret = get_num_possible_cpus_fallback(); + +end: + return ret; +} +#else +/* + * On other platforms, only use sysconf. + */ +static inline int get_possible_cpus_array_len(void) +{ + return get_num_possible_cpus_sysconf(); +} +#endif diff --git a/src/compat_arch.c b/src/compat_arch.c index e1651d3..474a832 100644 --- a/src/compat_arch.c +++ b/src/compat_arch.c @@ -1,28 +1,14 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * compat_arch.c - * * Userspace RCU library - architecture compatibility checks - * - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include -#if defined(URCU_ARCH_I386) +#ifdef URCU_ARCH_X86_NO_CAS #include #include diff --git a/src/compat_futex.c b/src/compat_futex.c index 9281138..151a40c 100644 --- a/src/compat_futex.c +++ b/src/compat_futex.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * compat_futex.c - * * Userspace RCU library - sys_futex compatibility code - * - * Copyright (c) 2009 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/src/lfstack.c b/src/lfstack.c index c974a47..5a2c80f 100644 --- a/src/lfstack.c +++ b/src/lfstack.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * lfstack.c - * * Userspace RCU library - Lock-Free Stack - * - * Copyright 2010-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ diff --git a/src/liburcu-bp.pc.in b/src/liburcu-bp.pc.in index 7cba58a..4f89fc2 100644 --- a/src/liburcu-bp.pc.in +++ b/src/liburcu-bp.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/liburcu-cds.pc.in b/src/liburcu-cds.pc.in index 1cb19b6..945666c 100644 --- a/src/liburcu-cds.pc.in +++ b/src/liburcu-cds.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/liburcu-mb.pc.in b/src/liburcu-mb.pc.in index 1684701..fcd32e0 100644 --- a/src/liburcu-mb.pc.in +++ b/src/liburcu-mb.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/liburcu-memb.pc.in b/src/liburcu-memb.pc.in index 5fb8476..b72008d 100644 --- a/src/liburcu-memb.pc.in +++ b/src/liburcu-memb.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/liburcu-qsbr.pc.in b/src/liburcu-qsbr.pc.in index d123a10..2dc6998 100644 --- a/src/liburcu-qsbr.pc.in +++ b/src/liburcu-qsbr.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/liburcu-signal.pc.in b/src/liburcu-signal.pc.in deleted file mode 100644 index 844c449..0000000 --- a/src/liburcu-signal.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Userspace RCU signal -Description: A userspace RCU (read-copy-update) library, signal version -Version: @PACKAGE_VERSION@ -Requires: -Libs: -L${libdir} -lurcu-common -lurcu-signal -Cflags: -I${includedir} diff --git a/src/liburcu.pc.in b/src/liburcu.pc.in index b9f812b..8f738ae 100644 --- a/src/liburcu.pc.in +++ b/src/liburcu.pc.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ diff --git a/src/rculfhash-internal.h b/src/rculfhash-internal.h index e17210b..7225ec9 100644 --- a/src/rculfhash-internal.h +++ b/src/rculfhash-internal.h @@ -1,27 +1,13 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_RCULFHASH_INTERNAL_H #define _URCU_RCULFHASH_INTERNAL_H /* - * urcu/rculfhash-internal.h - * * Internal header for Lock-Free RCU Hash Table - * - * Copyright 2011 - Mathieu Desnoyers - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -29,6 +15,8 @@ #include #include +#include "workqueue.h" + #ifdef DEBUG #define dbg_printf(fmt, args...) printf("[debug rculfhash] " fmt, ## args) #else @@ -71,6 +59,7 @@ struct cds_lfht { /* Initial configuration items */ unsigned long max_nr_buckets; const struct cds_lfht_mm_type *mm; /* memory management plugin */ + const struct cds_lfht_alloc *alloc; /* memory allocator for mm */ const struct rcu_flavor_struct *flavor; /* RCU flavor */ long count; /* global approximate item count */ @@ -82,11 +71,13 @@ struct cds_lfht { * therefore cause grace-period deadlock if we hold off RCU G.P. * completion. */ - pthread_mutex_t resize_mutex; /* resize mutex: add/del mutex */ - pthread_attr_t *resize_attr; /* Resize threads attributes */ + pthread_mutex_t resize_mutex; /* resize mutex: add/del mutex */ + pthread_attr_t *caller_resize_attr; /* resize threads attributes from lfht_new caller */ + pthread_attr_t resize_attr; unsigned int in_progress_destroy; unsigned long resize_target; int resize_initiated; + struct urcu_work destroy_work; /* * Variables needed for add and remove fast-paths. @@ -149,30 +140,32 @@ extern unsigned int cds_lfht_fls_ulong(unsigned long x); extern int cds_lfht_get_count_order_ulong(unsigned long x); #ifdef POISON_FREE -#define poison_free(ptr) \ +#define poison_free(alloc, ptr) \ do { \ if (ptr) { \ memset(ptr, 0x42, sizeof(*(ptr))); \ - free(ptr); \ + alloc->free(alloc->state, ptr); \ } \ } while (0) #else -#define poison_free(ptr) free(ptr) +#define poison_free(alloc, ptr) alloc->free(alloc->state, ptr) #endif static inline struct cds_lfht *__default_alloc_cds_lfht( const struct cds_lfht_mm_type *mm, + const struct cds_lfht_alloc *alloc, unsigned long cds_lfht_size, unsigned long min_nr_alloc_buckets, unsigned long max_nr_buckets) { struct cds_lfht *ht; - ht = calloc(1, cds_lfht_size); + ht = alloc->calloc(alloc->state, 1, cds_lfht_size); urcu_posix_assert(ht); ht->mm = mm; + ht->alloc = alloc; ht->bucket_at = mm->bucket_at; ht->min_nr_alloc_buckets = min_nr_alloc_buckets; ht->min_alloc_buckets_order = diff --git a/src/rculfhash-mm-chunk.c b/src/rculfhash-mm-chunk.c index 9273ac9..93931ee 100644 --- a/src/rculfhash-mm-chunk.c +++ b/src/rculfhash-mm-chunk.c @@ -1,42 +1,28 @@ +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfhash-mm-chunk.c - * * Chunk based memory management for Lock-Free RCU Hash Table - * - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include -#include +#include "rculfhash-internal.h" static void cds_lfht_alloc_bucket_table(struct cds_lfht *ht, unsigned long order) { if (order == 0) { - ht->tbl_chunk[0] = calloc(ht->min_nr_alloc_buckets, - sizeof(struct cds_lfht_node)); + ht->tbl_chunk[0] = ht->alloc->calloc(ht->alloc->state, + ht->min_nr_alloc_buckets, sizeof(struct cds_lfht_node)); urcu_posix_assert(ht->tbl_chunk[0]); } else if (order > ht->min_alloc_buckets_order) { unsigned long i, len = 1UL << (order - 1 - ht->min_alloc_buckets_order); for (i = len; i < 2 * len; i++) { - ht->tbl_chunk[i] = calloc(ht->min_nr_alloc_buckets, - sizeof(struct cds_lfht_node)); + ht->tbl_chunk[i] = ht->alloc->calloc(ht->alloc->state, + ht->min_nr_alloc_buckets, sizeof(struct cds_lfht_node)); urcu_posix_assert(ht->tbl_chunk[i]); } } @@ -52,12 +38,12 @@ static void cds_lfht_free_bucket_table(struct cds_lfht *ht, unsigned long order) { if (order == 0) - poison_free(ht->tbl_chunk[0]); + poison_free(ht->alloc, ht->tbl_chunk[0]); else if (order > ht->min_alloc_buckets_order) { unsigned long i, len = 1UL << (order - 1 - ht->min_alloc_buckets_order); for (i = len; i < 2 * len; i++) - poison_free(ht->tbl_chunk[i]); + poison_free(ht->alloc, ht->tbl_chunk[i]); } /* Nothing to do for 0 < order && order <= ht->min_alloc_buckets_order */ } @@ -74,7 +60,7 @@ struct cds_lfht_node *bucket_at(struct cds_lfht *ht, unsigned long index) static struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, - unsigned long max_nr_buckets) + unsigned long max_nr_buckets, const struct cds_lfht_alloc *alloc) { unsigned long nr_chunks, cds_lfht_size; @@ -86,7 +72,7 @@ struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, cds_lfht_size = max(cds_lfht_size, sizeof(struct cds_lfht)); return __default_alloc_cds_lfht( - &cds_lfht_mm_chunk, cds_lfht_size, + &cds_lfht_mm_chunk, alloc, cds_lfht_size, min_nr_alloc_buckets, max_nr_buckets); } diff --git a/src/rculfhash-mm-mmap.c b/src/rculfhash-mm-mmap.c index 4bce972..2b4bc42 100644 --- a/src/rculfhash-mm-mmap.c +++ b/src/rculfhash-mm-mmap.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfhash-mm-mmap.c - * * mmap/reservation based memory management for Lock-Free RCU Hash Table - * - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -132,8 +118,8 @@ void cds_lfht_alloc_bucket_table(struct cds_lfht *ht, unsigned long order) if (order == 0) { if (ht->min_nr_alloc_buckets == ht->max_nr_buckets) { /* small table */ - ht->tbl_mmap = calloc(ht->max_nr_buckets, - sizeof(*ht->tbl_mmap)); + ht->tbl_mmap = ht->alloc->calloc(ht->alloc->state, + ht->max_nr_buckets, sizeof(*ht->tbl_mmap)); urcu_posix_assert(ht->tbl_mmap); return; } @@ -164,7 +150,7 @@ void cds_lfht_free_bucket_table(struct cds_lfht *ht, unsigned long order) if (order == 0) { if (ht->min_nr_alloc_buckets == ht->max_nr_buckets) { /* small table */ - poison_free(ht->tbl_mmap); + poison_free(ht->alloc, ht->tbl_mmap); return; } /* large table */ @@ -188,7 +174,7 @@ struct cds_lfht_node *bucket_at(struct cds_lfht *ht, unsigned long index) static struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, - unsigned long max_nr_buckets) + unsigned long max_nr_buckets, const struct cds_lfht_alloc *alloc) { unsigned long page_bucket_size; @@ -203,7 +189,7 @@ struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, } return __default_alloc_cds_lfht( - &cds_lfht_mm_mmap, sizeof(struct cds_lfht), + &cds_lfht_mm_mmap, alloc, sizeof(struct cds_lfht), min_nr_alloc_buckets, max_nr_buckets); } diff --git a/src/rculfhash-mm-order.c b/src/rculfhash-mm-order.c index a182a83..2b0f707 100644 --- a/src/rculfhash-mm-order.c +++ b/src/rculfhash-mm-order.c @@ -1,39 +1,25 @@ +// SPDX-FileCopyrightText: 2011 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfhash-mm-order.c - * * Order based memory management for Lock-Free RCU Hash Table - * - * Copyright 2011 - Mathieu Desnoyers - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include -#include +#include "rculfhash-internal.h" static void cds_lfht_alloc_bucket_table(struct cds_lfht *ht, unsigned long order) { if (order == 0) { - ht->tbl_order[0] = calloc(ht->min_nr_alloc_buckets, - sizeof(struct cds_lfht_node)); + ht->tbl_order[0] = ht->alloc->calloc(ht->alloc->state, + ht->min_nr_alloc_buckets, sizeof(struct cds_lfht_node)); urcu_posix_assert(ht->tbl_order[0]); } else if (order > ht->min_alloc_buckets_order) { - ht->tbl_order[order] = calloc(1UL << (order -1), - sizeof(struct cds_lfht_node)); + ht->tbl_order[order] = ht->alloc->calloc(ht->alloc->state, + 1UL << (order -1), sizeof(struct cds_lfht_node)); urcu_posix_assert(ht->tbl_order[order]); } /* Nothing to do for 0 < order && order <= ht->min_alloc_buckets_order */ @@ -48,9 +34,9 @@ static void cds_lfht_free_bucket_table(struct cds_lfht *ht, unsigned long order) { if (order == 0) - poison_free(ht->tbl_order[0]); + poison_free(ht->alloc, ht->tbl_order[0]); else if (order > ht->min_alloc_buckets_order) - poison_free(ht->tbl_order[order]); + poison_free(ht->alloc, ht->tbl_order[order]); /* Nothing to do for 0 < order && order <= ht->min_alloc_buckets_order */ } @@ -76,10 +62,10 @@ struct cds_lfht_node *bucket_at(struct cds_lfht *ht, unsigned long index) static struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, - unsigned long max_nr_buckets) + unsigned long max_nr_buckets, const struct cds_lfht_alloc *alloc) { return __default_alloc_cds_lfht( - &cds_lfht_mm_order, sizeof(struct cds_lfht), + &cds_lfht_mm_order, alloc, sizeof(struct cds_lfht), min_nr_alloc_buckets, max_nr_buckets); } diff --git a/src/rculfhash.c b/src/rculfhash.c index 04fd499..10f5b8e 100644 --- a/src/rculfhash.c +++ b/src/rculfhash.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010-2011 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfhash.c - * * Userspace RCU library - Lock-Free Resizable RCU Hash Table - * - * Copyright 2010-2011 - Mathieu Desnoyers - * Copyright 2011 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* @@ -263,6 +249,7 @@ #include #include #include +#include #include "compat-getcpu.h" #include @@ -273,14 +260,14 @@ #include #include #include -#include -#include #include #include #include +#include "rculfhash-internal.h" #include "workqueue.h" #include "urcu-die.h" #include "urcu-utils.h" +#include "compat-smp.h" /* * Split-counters lazily update the global counter each 1024 @@ -361,8 +348,12 @@ struct partition_resize_work { unsigned long start, unsigned long len); }; +enum nr_cpus_mask_state { + NR_CPUS_MASK_INIT_FAILED = -2, + NR_CPUS_MASK_UNINITIALIZED = -1, +}; + static struct urcu_workqueue *cds_lfht_workqueue; -static unsigned long cds_lfht_workqueue_user_count; /* * Mutex ensuring mutual exclusion between workqueue initialization and @@ -379,8 +370,8 @@ static struct urcu_atfork cds_lfht_atfork; */ static int cds_lfht_workqueue_atfork_nesting; +static void __attribute__((destructor)) cds_lfht_exit(void); static void cds_lfht_init_worker(const struct rcu_flavor_struct *flavor); -static void cds_lfht_fini_worker(const struct rcu_flavor_struct *flavor); #ifdef CONFIG_CDS_LFHT_ITER_DEBUG @@ -578,6 +569,50 @@ unsigned int cds_lfht_fls_ulong(unsigned long x) #endif } +static void *cds_lfht_malloc(void *state __attribute__((unused)), + size_t size) +{ + return malloc(size); +} + +static void *cds_lfht_calloc(void *state __attribute__((unused)), + size_t nmemb, size_t size) +{ + return calloc(nmemb, size); +} + +static void *cds_lfht_realloc(void *state __attribute__((unused)), + void *ptr, size_t size) +{ + return realloc(ptr, size); +} + +static void *cds_lfht_aligned_alloc(void *state __attribute__((unused)), + size_t alignment, size_t size) +{ + void *ptr; + + if (posix_memalign(&ptr, alignment, size)) + return NULL; + return ptr; +} + +static void cds_lfht_free(void *state __attribute__((unused)), void *ptr) +{ + free(ptr); +} + + +/* Default memory allocator */ +static struct cds_lfht_alloc cds_lfht_default_alloc = { + .malloc = cds_lfht_malloc, + .calloc = cds_lfht_calloc, + .realloc = cds_lfht_realloc, + .aligned_alloc = cds_lfht_aligned_alloc, + .free = cds_lfht_free, + .state = NULL, +}; + /* * Return the minimum order for which x <= (1UL << order). * Return -1 if x is 0. @@ -623,9 +658,7 @@ static void mutex_lock(pthread_mutex_t *mutex) if (ret != EBUSY && ret != EINTR) urcu_die(ret); if (CMM_LOAD_SHARED(URCU_TLS(rcu_reader).need_mb)) { - cmm_smp_mb(); - _CMM_STORE_SHARED(URCU_TLS(rcu_reader).need_mb, 0); - cmm_smp_mb(); + uatomic_store(&URCU_TLS(rcu_reader).need_mb, 0, CMM_SEQ_CST); } (void) poll(NULL, 0, 10); } @@ -641,18 +674,17 @@ static void mutex_unlock(pthread_mutex_t *mutex) urcu_die(ret); } -static long nr_cpus_mask = -1; +static long nr_cpus_mask = NR_CPUS_MASK_UNINITIALIZED; static long split_count_mask = -1; static int split_count_order = -1; -#if defined(HAVE_SYSCONF) static void ht_init_nr_cpus_mask(void) { long maxcpus; - maxcpus = sysconf(_SC_NPROCESSORS_CONF); + maxcpus = get_possible_cpus_array_len(); if (maxcpus <= 0) { - nr_cpus_mask = -2; + nr_cpus_mask = NR_CPUS_MASK_INIT_FAILED; return; } /* @@ -662,17 +694,11 @@ static void ht_init_nr_cpus_mask(void) maxcpus = 1UL << cds_lfht_get_count_order_ulong(maxcpus); nr_cpus_mask = maxcpus - 1; } -#else /* #if defined(HAVE_SYSCONF) */ -static void ht_init_nr_cpus_mask(void) -{ - nr_cpus_mask = -2; -} -#endif /* #else #if defined(HAVE_SYSCONF) */ static void alloc_split_items_count(struct cds_lfht *ht) { - if (nr_cpus_mask == -1) { + if (nr_cpus_mask == NR_CPUS_MASK_UNINITIALIZED) { ht_init_nr_cpus_mask(); if (nr_cpus_mask < 0) split_count_mask = DEFAULT_SPLIT_COUNT_MASK; @@ -685,7 +711,7 @@ void alloc_split_items_count(struct cds_lfht *ht) urcu_posix_assert(split_count_mask >= 0); if (ht->flags & CDS_LFHT_ACCOUNTING) { - ht->split_count = calloc(split_count_mask + 1, + ht->split_count = ht->alloc->calloc(ht->alloc->state, split_count_mask + 1, sizeof(struct ht_items_count)); urcu_posix_assert(ht->split_count); } else { @@ -696,7 +722,7 @@ void alloc_split_items_count(struct cds_lfht *ht) static void free_split_items_count(struct cds_lfht *ht) { - poison_free(ht->split_count); + poison_free(ht->alloc, ht->split_count); } static @@ -763,7 +789,7 @@ void ht_count_del(struct cds_lfht *ht, unsigned long size, unsigned long hash) if ((count >> CHAIN_LEN_RESIZE_THRESHOLD) >= size) return; - dbg_printf("del set global %ld\n", count); + dbg_printf("del set global %lu\n", count); /* * Don't shrink table if the number of nodes is below a * certain threshold. @@ -851,6 +877,12 @@ int is_removal_owner(struct cds_lfht_node *node) return ((unsigned long) node) & REMOVAL_OWNER_FLAG; } +static +struct cds_lfht_node *flag_removed(struct cds_lfht_node *node) +{ + return (struct cds_lfht_node *) (((unsigned long) node) | REMOVED_FLAG); +} + static struct cds_lfht_node *flag_removal_owner(struct cds_lfht_node *node) { @@ -884,8 +916,10 @@ unsigned long _uatomic_xchg_monotonic_increase(unsigned long *ptr, old1 = uatomic_read(ptr); do { old2 = old1; - if (old2 >= v) + if (old2 >= v) { + cmm_smp_mb(); return old2; + } } while ((old1 = uatomic_cmpxchg(ptr, old2, v)) != old2); return old2; } @@ -1169,6 +1203,7 @@ int _cds_lfht_del(struct cds_lfht *ht, unsigned long size, struct cds_lfht_node *node) { struct cds_lfht_node *bucket, *next; + uintptr_t *node_next; if (!node) /* Return -ENOENT if asked to delete NULL node */ return -ENOENT; @@ -1191,15 +1226,18 @@ int _cds_lfht_del(struct cds_lfht *ht, unsigned long size, /* * The del operation semantic guarantees a full memory barrier * before the uatomic_or atomic commit of the deletion flag. - */ - cmm_smp_mb__before_uatomic_or(); - /* + * * We set the REMOVED_FLAG unconditionally. Note that there may * be more than one concurrent thread setting this flag. * Knowing which wins the race will be known after the garbage * collection phase, stay tuned! + * + * NOTE: The node_next variable is present to avoid breaking + * strict-aliasing rules. */ - uatomic_or(&node->next, REMOVED_FLAG); + node_next = (uintptr_t*)&node->next; + uatomic_or_mo(node_next, REMOVED_FLAG, CMM_RELEASE); + /* We performed the (logical) deletion. */ /* @@ -1224,7 +1262,7 @@ int _cds_lfht_del(struct cds_lfht *ht, unsigned long size, * was already set). */ if (!is_removal_owner(uatomic_xchg(&node->next, - flag_removal_owner(node->next)))) + flag_removal_owner(uatomic_load(&node->next, CMM_RELAXED))))) return 0; else return -ENOENT; @@ -1251,8 +1289,9 @@ void partition_resize_helper(struct cds_lfht *ht, unsigned long i, struct partition_resize_work *work; int ret; unsigned long thread, nr_threads; + sigset_t newmask, oldmask; - urcu_posix_assert(nr_cpus_mask != -1); + urcu_posix_assert(nr_cpus_mask != NR_CPUS_MASK_UNINITIALIZED); if (nr_cpus_mask < 0 || len < 2 * MIN_PARTITION_PER_THREAD) goto fallback; @@ -1268,18 +1307,25 @@ void partition_resize_helper(struct cds_lfht *ht, unsigned long i, nr_threads = 1; } partition_len = len >> cds_lfht_get_count_order_ulong(nr_threads); - work = calloc(nr_threads, sizeof(*work)); + work = ht->alloc->calloc(ht->alloc->state, nr_threads, sizeof(*work)); if (!work) { dbg_printf("error allocating for resize, single-threading\n"); goto fallback; } + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); + for (thread = 0; thread < nr_threads; thread++) { work[thread].ht = ht; work[thread].i = i; work[thread].len = partition_len; work[thread].start = thread * partition_len; work[thread].fct = fct; - ret = pthread_create(&(work[thread].thread_id), ht->resize_attr, + ret = pthread_create(&(work[thread].thread_id), + ht->caller_resize_attr ? &ht->resize_attr : NULL, partition_resize_thread, &work[thread]); if (ret == EAGAIN) { /* @@ -1294,11 +1340,15 @@ void partition_resize_helper(struct cds_lfht *ht, unsigned long i, } urcu_posix_assert(!ret); } + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); + urcu_posix_assert(!ret); + for (thread = 0; thread < nr_threads; thread++) { ret = pthread_join(work[thread].thread_id, NULL); urcu_posix_assert(!ret); } - free(work); + ht->alloc->free(ht->alloc->state, work); /* * A pthread_create failure above will either lead in us having @@ -1378,9 +1428,10 @@ void init_table(struct cds_lfht *ht, /* * Update table size. + * + * Populate data before RCU size. */ - cmm_smp_wmb(); /* populate data before RCU size */ - CMM_STORE_SHARED(ht->size, 1UL << i); + uatomic_store(&ht->size, 1UL << i, CMM_RELEASE); dbg_printf("init new size: %lu\n", 1UL << i); if (CMM_LOAD_SHARED(ht->in_progress_destroy)) @@ -1425,12 +1476,18 @@ void remove_table_partition(struct cds_lfht *ht, unsigned long i, for (j = size + start; j < size + start + len; j++) { struct cds_lfht_node *fini_bucket = bucket_at(ht, j); struct cds_lfht_node *parent_bucket = bucket_at(ht, j - size); + uintptr_t *fini_bucket_next; urcu_posix_assert(j >= size && j < (size << 1)); dbg_printf("remove entry: order %lu index %lu hash %lu\n", i, j, j); - /* Set the REMOVED_FLAG to freeze the ->next for gc */ - uatomic_or(&fini_bucket->next, REMOVED_FLAG); + /* Set the REMOVED_FLAG to freeze the ->next for gc. + * + * NOTE: The fini_bucket_next variable is present to + * avoid breaking strict-aliasing rules. + */ + fini_bucket_next = (uintptr_t*)&fini_bucket->next; + uatomic_or(fini_bucket_next, REMOVED_FLAG); _cds_lfht_gc_bucket(parent_bucket, fini_bucket); } ht->flavor->read_unlock(); @@ -1578,12 +1635,19 @@ const struct cds_lfht_mm_type *get_mm_type( } #endif -struct cds_lfht *_cds_lfht_new(unsigned long init_size, +void cds_lfht_node_init_deleted(struct cds_lfht_node *node) +{ + cds_lfht_node_init(node); + node->next = flag_removed(NULL); +} + +struct cds_lfht *_cds_lfht_new_with_alloc(unsigned long init_size, unsigned long min_nr_alloc_buckets, unsigned long max_nr_buckets, int flags, const struct cds_lfht_mm_type *mm, const struct rcu_flavor_struct *flavor, + const struct cds_lfht_alloc *alloc, pthread_attr_t *attr) { struct cds_lfht *ht; @@ -1619,14 +1683,17 @@ struct cds_lfht *_cds_lfht_new(unsigned long init_size, max_nr_buckets = max(max_nr_buckets, min_nr_alloc_buckets); init_size = min(init_size, max_nr_buckets); - ht = mm->alloc_cds_lfht(min_nr_alloc_buckets, max_nr_buckets); + ht = mm->alloc_cds_lfht(min_nr_alloc_buckets, max_nr_buckets, alloc ? : &cds_lfht_default_alloc); + urcu_posix_assert(ht); urcu_posix_assert(ht->mm == mm); urcu_posix_assert(ht->bucket_at == mm->bucket_at); ht->flags = flags; ht->flavor = flavor; - ht->resize_attr = attr; + ht->caller_resize_attr = attr; + if (attr) + ht->resize_attr = *attr; alloc_split_items_count(ht); /* this mutex should not nest in read-side C.S. */ pthread_mutex_init(&ht->resize_mutex, NULL); @@ -1637,6 +1704,19 @@ struct cds_lfht *_cds_lfht_new(unsigned long init_size, return ht; } +struct cds_lfht *_cds_lfht_new(unsigned long init_size, + unsigned long min_nr_alloc_buckets, + unsigned long max_nr_buckets, + int flags, + const struct cds_lfht_mm_type *mm, + const struct rcu_flavor_struct *flavor, + pthread_attr_t *attr) +{ + return _cds_lfht_new_with_alloc(init_size, + min_nr_alloc_buckets, max_nr_buckets, + flags, mm, flavor, NULL, attr); +} + void cds_lfht_lookup(struct cds_lfht *ht, unsigned long hash, cds_lfht_match_fct match, const void *key, struct cds_lfht_iter *iter) @@ -1648,7 +1728,14 @@ void cds_lfht_lookup(struct cds_lfht *ht, unsigned long hash, reverse_hash = bit_reverse_ulong(hash); - size = rcu_dereference(ht->size); + /* + * Use load acquire instead of rcu_dereference because there is no + * dependency between the table size and the dereference of the bucket + * content. + * + * This acquire is paired with the store release in init_table(). + */ + size = uatomic_load(&ht->size, CMM_ACQUIRE); bucket = lookup_bucket(ht, size, hash); /* We can always skip the bucket node initially */ node = rcu_dereference(bucket->next); @@ -1707,7 +1794,7 @@ void cds_lfht_next_duplicate(struct cds_lfht *ht __attribute__((unused)), } node = clear_flag(next); } - urcu_posix_assert(!node || !is_bucket(CMM_LOAD_SHARED(node->next))); + urcu_posix_assert(!node || !is_bucket(uatomic_load(&node->next, CMM_RELAXED))); iter->node = node; iter->next = next; } @@ -1731,7 +1818,7 @@ void cds_lfht_next(struct cds_lfht *ht __attribute__((unused)), } node = clear_flag(next); } - urcu_posix_assert(!node || !is_bucket(CMM_LOAD_SHARED(node->next))); + urcu_posix_assert(!node || !is_bucket(uatomic_load(&node->next, CMM_RELAXED))); iter->node = node; iter->next = next; } @@ -1743,7 +1830,7 @@ void cds_lfht_first(struct cds_lfht *ht, struct cds_lfht_iter *iter) * Get next after first bucket node. The first bucket node is the * first node of the linked list. */ - iter->next = bucket_at(ht, 0)->next; + iter->next = uatomic_load(&bucket_at(ht, 0)->next, CMM_CONSUME); cds_lfht_next(ht, iter); } @@ -1753,7 +1840,7 @@ void cds_lfht_add(struct cds_lfht *ht, unsigned long hash, unsigned long size; node->reverse_hash = bit_reverse_ulong(hash); - size = rcu_dereference(ht->size); + size = uatomic_load(&ht->size, CMM_ACQUIRE); _cds_lfht_add(ht, hash, NULL, NULL, size, node, NULL, 0); ht_count_add(ht, size, hash); } @@ -1768,7 +1855,7 @@ struct cds_lfht_node *cds_lfht_add_unique(struct cds_lfht *ht, struct cds_lfht_iter iter; node->reverse_hash = bit_reverse_ulong(hash); - size = rcu_dereference(ht->size); + size = uatomic_load(&ht->size, CMM_ACQUIRE); _cds_lfht_add(ht, hash, match, key, size, node, &iter, 0); if (iter.node == node) ht_count_add(ht, size, hash); @@ -1785,7 +1872,7 @@ struct cds_lfht_node *cds_lfht_add_replace(struct cds_lfht *ht, struct cds_lfht_iter iter; node->reverse_hash = bit_reverse_ulong(hash); - size = rcu_dereference(ht->size); + size = uatomic_load(&ht->size, CMM_ACQUIRE); for (;;) { _cds_lfht_add(ht, hash, match, key, size, node, &iter, 0); if (iter.node == node) { @@ -1814,7 +1901,7 @@ int cds_lfht_replace(struct cds_lfht *ht, return -EINVAL; if (caa_unlikely(!match(old_iter->node, key))) return -EINVAL; - size = rcu_dereference(ht->size); + size = uatomic_load(&ht->size, CMM_ACQUIRE); return _cds_lfht_replace(ht, size, old_iter->node, old_iter->next, new_node); } @@ -1824,7 +1911,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node) unsigned long size; int ret; - size = rcu_dereference(ht->size); + size = uatomic_load(&ht->size, CMM_ACQUIRE); ret = _cds_lfht_del(ht, size, node); if (!ret) { unsigned long hash; @@ -1840,6 +1927,35 @@ int cds_lfht_is_node_deleted(const struct cds_lfht_node *node) return is_removed(CMM_LOAD_SHARED(node->next)); } +static +bool cds_lfht_is_empty(struct cds_lfht *ht) +{ + struct cds_lfht_node *node, *next; + bool empty = true; + bool was_online; + + was_online = ht->flavor->read_ongoing(); + if (!was_online) { + ht->flavor->thread_online(); + ht->flavor->read_lock(); + } + /* Check that the table is empty */ + node = bucket_at(ht, 0); + do { + next = rcu_dereference(node->next); + if (!is_bucket(next)) { + empty = false; + break; + } + node = clear_flag(next); + } while (!is_end(node)); + if (!was_online) { + ht->flavor->read_unlock(); + ht->flavor->thread_offline(); + } + return empty; +} + static int cds_lfht_delete_bucket(struct cds_lfht *ht) { @@ -1874,6 +1990,24 @@ int cds_lfht_delete_bucket(struct cds_lfht *ht) return 0; } +static +void do_auto_resize_destroy_cb(struct urcu_work *work) +{ + struct cds_lfht *ht = caa_container_of(work, struct cds_lfht, destroy_work); + int ret; + + ht->flavor->register_thread(); + ret = cds_lfht_delete_bucket(ht); + if (ret) + urcu_die(-ret); + free_split_items_count(ht); + ret = pthread_mutex_destroy(&ht->resize_mutex); + if (ret) + urcu_die(ret); + ht->flavor->unregister_thread(); + poison_free(ht->alloc, ht); +} + /* * Should only be called when no more concurrent readers nor writers can * possibly access the table. @@ -1883,23 +2017,39 @@ int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr) int ret; if (ht->flags & CDS_LFHT_AUTO_RESIZE) { + /* + * Perform error-checking for emptiness before queuing + * work, so we can return error to the caller. This runs + * concurrently with ongoing resize. + */ + if (!cds_lfht_is_empty(ht)) + return -EPERM; /* Cancel ongoing resize operations. */ - _CMM_STORE_SHARED(ht->in_progress_destroy, 1); - /* Wait for in-flight resize operations to complete */ - urcu_workqueue_flush_queued_work(cds_lfht_workqueue); + uatomic_store(&ht->in_progress_destroy, 1, CMM_RELAXED); + if (attr) { + *attr = ht->caller_resize_attr; + ht->caller_resize_attr = NULL; + } + /* + * Queue destroy work after prior queued resize + * operations. Given there are no concurrent writers + * accessing the hash table at this point, no resize + * operations can be queued after this destroy work. + */ + urcu_workqueue_queue_work(cds_lfht_workqueue, + &ht->destroy_work, do_auto_resize_destroy_cb); + return 0; } ret = cds_lfht_delete_bucket(ht); if (ret) return ret; free_split_items_count(ht); if (attr) - *attr = ht->resize_attr; + *attr = ht->caller_resize_attr; ret = pthread_mutex_destroy(&ht->resize_mutex); if (ret) ret = -EBUSY; - if (ht->flags & CDS_LFHT_AUTO_RESIZE) - cds_lfht_fini_worker(ht->flavor); - poison_free(ht); + poison_free(ht->alloc, ht); return ret; } @@ -1995,19 +2145,22 @@ void _do_cds_lfht_resize(struct cds_lfht *ht) * Resize table, re-do if the target size has changed under us. */ do { - if (CMM_LOAD_SHARED(ht->in_progress_destroy)) + if (uatomic_load(&ht->in_progress_destroy, CMM_RELAXED)) break; - ht->resize_initiated = 1; + + uatomic_store(&ht->resize_initiated, 1, CMM_RELAXED); + old_size = ht->size; - new_size = CMM_LOAD_SHARED(ht->resize_target); + new_size = uatomic_load(&ht->resize_target, CMM_RELAXED); if (old_size < new_size) _do_cds_lfht_grow(ht, old_size, new_size); else if (old_size > new_size) _do_cds_lfht_shrink(ht, old_size, new_size); - ht->resize_initiated = 0; + + uatomic_store(&ht->resize_initiated, 0, CMM_RELAXED); /* write resize_initiated before read resize_target */ cmm_smp_mb(); - } while (ht->size != CMM_LOAD_SHARED(ht->resize_target)); + } while (ht->size != uatomic_load(&ht->resize_target, CMM_RELAXED)); } static @@ -2028,7 +2181,12 @@ void resize_target_update_count(struct cds_lfht *ht, void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size) { resize_target_update_count(ht, new_size); - CMM_STORE_SHARED(ht->resize_initiated, 1); + + /* + * Set flags has early as possible even in contention case. + */ + uatomic_store(&ht->resize_initiated, 1, CMM_RELAXED); + mutex_lock(&ht->resize_mutex); _do_cds_lfht_resize(ht); mutex_unlock(&ht->resize_mutex); @@ -2046,7 +2204,7 @@ void do_resize_cb(struct urcu_work *work) _do_cds_lfht_resize(ht); mutex_unlock(&ht->resize_mutex); ht->flavor->unregister_thread(); - poison_free(work); + poison_free(ht->alloc, work); } static @@ -2054,13 +2212,15 @@ void __cds_lfht_resize_lazy_launch(struct cds_lfht *ht) { struct resize_work *work; - /* Store resize_target before read resize_initiated */ - cmm_smp_mb(); - if (!CMM_LOAD_SHARED(ht->resize_initiated)) { - if (CMM_LOAD_SHARED(ht->in_progress_destroy)) { + /* + * Store to resize_target is before read resize_initiated as guaranteed + * by either cmpxchg or _uatomic_xchg_monotonic_increase. + */ + if (!uatomic_load(&ht->resize_initiated, CMM_RELAXED)) { + if (uatomic_load(&ht->in_progress_destroy, CMM_RELAXED)) { return; } - work = malloc(sizeof(*work)); + work = ht->alloc->malloc(ht->alloc->state, sizeof(*work)); if (work == NULL) { dbg_printf("error allocating resize work, bailing out\n"); return; @@ -2068,7 +2228,7 @@ void __cds_lfht_resize_lazy_launch(struct cds_lfht *ht) work->ht = ht; urcu_workqueue_queue_work(cds_lfht_workqueue, &work->work, do_resize_cb); - CMM_STORE_SHARED(ht->resize_initiated, 1); + uatomic_store(&ht->resize_initiated, 1, CMM_RELAXED); } } @@ -2157,51 +2317,24 @@ static struct urcu_atfork cds_lfht_atfork = { .after_fork_child = cds_lfht_after_fork_child, }; -/* - * Block all signals for the workqueue worker thread to ensure we don't - * disturb the application. The SIGRCU signal needs to be unblocked for - * the urcu-signal flavor. - */ -static void cds_lfht_worker_init( - struct urcu_workqueue *workqueue __attribute__((unused)), - void *priv __attribute__((unused))) -{ - int ret; - sigset_t mask; - - ret = sigfillset(&mask); - if (ret) - urcu_die(errno); - ret = sigdelset(&mask, SIGRCU); - if (ret) - urcu_die(errno); - ret = pthread_sigmask(SIG_SETMASK, &mask, NULL); - if (ret) - urcu_die(ret); -} - static void cds_lfht_init_worker(const struct rcu_flavor_struct *flavor) { flavor->register_rculfhash_atfork(&cds_lfht_atfork); mutex_lock(&cds_lfht_fork_mutex); - if (cds_lfht_workqueue_user_count++) - goto end; - cds_lfht_workqueue = urcu_workqueue_create(0, -1, NULL, - NULL, cds_lfht_worker_init, NULL, NULL, NULL, NULL, NULL); -end: + if (!cds_lfht_workqueue) + cds_lfht_workqueue = urcu_workqueue_create(0, -1, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL); mutex_unlock(&cds_lfht_fork_mutex); } -static void cds_lfht_fini_worker(const struct rcu_flavor_struct *flavor) +static void cds_lfht_exit(void) { mutex_lock(&cds_lfht_fork_mutex); - if (--cds_lfht_workqueue_user_count) - goto end; - urcu_workqueue_destroy(cds_lfht_workqueue); - cds_lfht_workqueue = NULL; -end: + if (cds_lfht_workqueue) { + urcu_workqueue_flush_queued_work(cds_lfht_workqueue); + urcu_workqueue_destroy(cds_lfht_workqueue); + cds_lfht_workqueue = NULL; + } mutex_unlock(&cds_lfht_fork_mutex); - - flavor->unregister_rculfhash_atfork(&cds_lfht_atfork); } diff --git a/src/rculfqueue.c b/src/rculfqueue.c index 38eddcf..8b6e0a6 100644 --- a/src/rculfqueue.c +++ b/src/rculfqueue.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfqueue.c - * * Userspace RCU library - Lock-Free RCU Queue - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ diff --git a/src/rculfstack.c b/src/rculfstack.c index df5c547..d7b00ff 100644 --- a/src/rculfstack.c +++ b/src/rculfstack.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * rculfstack.c - * * Userspace RCU library - Lock-Free RCU Stack - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Remove deprecation warnings from LGPL wrapper build. */ diff --git a/src/urcu-bp.c b/src/urcu-bp.c index a097d7f..38f867e 100644 --- a/src/urcu-bp.c +++ b/src/urcu-bp.c @@ -1,25 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu-bp.c - * * Userspace RCU library, "bulletproof" version. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -36,6 +22,7 @@ #include #include +#include #include #include #include @@ -88,10 +75,7 @@ void *mremap_wrapper(void *old_address __attribute__((unused)), /* Sleep delay in ms */ #define RCU_SLEEP_DELAY_MS 10 -#define INIT_NR_THREADS 8 -#define ARENA_INIT_ALLOC \ - sizeof(struct registry_chunk) \ - + INIT_NR_THREADS * sizeof(struct urcu_bp_reader) +#define INIT_READER_COUNT 8 /* * Active attempts to check for reader Q.S. before calling sleep(). @@ -120,7 +104,10 @@ enum membarrier_cmd { static void __attribute__((constructor)) _urcu_bp_init(void); static -void __attribute__((destructor)) urcu_bp_exit(void); +void urcu_bp_exit(void); +static +void __attribute__((destructor)) urcu_bp_exit_destructor(void); +static void urcu_call_rcu_exit(void); #ifndef CONFIG_RCU_FORCE_SYS_MEMBARRIER int urcu_bp_has_sys_membarrier; @@ -158,10 +145,10 @@ DEFINE_URCU_TLS(struct urcu_bp_reader *, urcu_bp_reader); static CDS_LIST_HEAD(registry); struct registry_chunk { - size_t data_len; /* data length */ - size_t used; /* amount of data used */ + size_t capacity; /* capacity of this chunk (in elements) */ + size_t used; /* count of elements used */ struct cds_list_head node; /* chunk_list node */ - char data[]; + struct urcu_bp_reader readers[]; }; struct registry_arena { @@ -211,13 +198,21 @@ static void smp_mb_master(void) } } +/* Get the size of a chunk's allocation from its capacity (an element count). */ +static size_t chunk_allocation_size(size_t capacity) +{ + return (capacity * sizeof(struct urcu_bp_reader)) + + sizeof(struct registry_chunk); +} + /* * Always called with rcu_registry lock held. Releases this lock between * iterations and grabs it again. Holds the lock when it returns. */ static void wait_for_readers(struct cds_list_head *input_readers, struct cds_list_head *cur_snap_readers, - struct cds_list_head *qsreaders) + struct cds_list_head *qsreaders, + cmm_annotate_t *group) { unsigned int wait_loops = 0; struct urcu_bp_reader *index, *tmp; @@ -232,7 +227,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, wait_loops++; cds_list_for_each_entry_safe(index, tmp, input_readers, node) { - switch (urcu_bp_reader_state(&index->ctr)) { + switch (urcu_bp_reader_state(&index->ctr, group)) { case URCU_BP_READER_ACTIVE_CURRENT: if (cur_snap_readers) { cds_list_move(&index->node, @@ -271,6 +266,8 @@ static void wait_for_readers(struct cds_list_head *input_readers, void urcu_bp_synchronize_rcu(void) { + cmm_annotate_define(acquire_group); + cmm_annotate_define(release_group); CDS_LIST_HEAD(cur_snap_readers); CDS_LIST_HEAD(qsreaders); sigset_t newmask, oldmask; @@ -292,13 +289,14 @@ void urcu_bp_synchronize_rcu(void) * where new ptr points to. */ /* Write new ptr before changing the qparity */ smp_mb_master(); + cmm_annotate_group_mb_release(&release_group); /* * Wait for readers to observe original parity or be quiescent. * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(®istry, &cur_snap_readers, &qsreaders); + wait_for_readers(®istry, &cur_snap_readers, &qsreaders, &acquire_group); /* * Adding a cmm_smp_mb() which is _not_ formally required, but makes the @@ -308,7 +306,8 @@ void urcu_bp_synchronize_rcu(void) cmm_smp_mb(); /* Switch parity: 0 -> 1, 1 -> 0 */ - CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr ^ URCU_BP_GP_CTR_PHASE); + cmm_annotate_group_mem_release(&release_group, &rcu_gp.ctr); + uatomic_store(&rcu_gp.ctr, rcu_gp.ctr ^ URCU_BP_GP_CTR_PHASE, CMM_RELAXED); /* * Must commit qparity update to memory before waiting for other parity @@ -329,7 +328,7 @@ void urcu_bp_synchronize_rcu(void) * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(&cur_snap_readers, NULL, &qsreaders); + wait_for_readers(&cur_snap_readers, NULL, &qsreaders, &acquire_group); /* * Put quiescent reader list back into registry. @@ -341,6 +340,7 @@ void urcu_bp_synchronize_rcu(void) * freed. */ smp_mb_master(); + cmm_annotate_group_mb_acquire(&acquire_group); out: mutex_unlock(&rcu_registry_lock); mutex_unlock(&rcu_gp_lock); @@ -379,24 +379,20 @@ static void expand_arena(struct registry_arena *arena) { struct registry_chunk *new_chunk, *last_chunk; - size_t old_chunk_len, new_chunk_len; + size_t old_chunk_size_bytes, new_chunk_size_bytes, new_capacity; /* No chunk. */ if (cds_list_empty(&arena->chunk_list)) { - urcu_posix_assert(ARENA_INIT_ALLOC >= - sizeof(struct registry_chunk) - + sizeof(struct rcu_reader)); - new_chunk_len = ARENA_INIT_ALLOC; + new_chunk_size_bytes = chunk_allocation_size(INIT_READER_COUNT); new_chunk = (struct registry_chunk *) mmap(NULL, - new_chunk_len, + new_chunk_size_bytes, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (new_chunk == MAP_FAILED) abort(); - memset(new_chunk, 0, new_chunk_len); - new_chunk->data_len = - new_chunk_len - sizeof(struct registry_chunk); + memset(new_chunk, 0, new_chunk_size_bytes); + new_chunk->capacity = INIT_READER_COUNT; cds_list_add_tail(&new_chunk->node, &arena->chunk_list); return; /* We're done. */ } @@ -404,34 +400,32 @@ void expand_arena(struct registry_arena *arena) /* Try expanding last chunk. */ last_chunk = cds_list_entry(arena->chunk_list.prev, struct registry_chunk, node); - old_chunk_len = - last_chunk->data_len + sizeof(struct registry_chunk); - new_chunk_len = old_chunk_len << 1; + old_chunk_size_bytes = chunk_allocation_size(last_chunk->capacity); + new_capacity = last_chunk->capacity << 1; + new_chunk_size_bytes = chunk_allocation_size(new_capacity); /* Don't allow memory mapping to move, just expand. */ - new_chunk = mremap_wrapper(last_chunk, old_chunk_len, - new_chunk_len, 0); + new_chunk = mremap_wrapper(last_chunk, old_chunk_size_bytes, + new_chunk_size_bytes, 0); if (new_chunk != MAP_FAILED) { /* Should not have moved. */ - urcu_posix_assert(new_chunk == last_chunk); - memset((char *) last_chunk + old_chunk_len, 0, - new_chunk_len - old_chunk_len); - last_chunk->data_len = - new_chunk_len - sizeof(struct registry_chunk); + assert(new_chunk == last_chunk); + memset((char *) last_chunk + old_chunk_size_bytes, 0, + new_chunk_size_bytes - old_chunk_size_bytes); + last_chunk->capacity = new_capacity; return; /* We're done. */ } /* Remap did not succeed, we need to add a new chunk. */ new_chunk = (struct registry_chunk *) mmap(NULL, - new_chunk_len, + new_chunk_size_bytes, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (new_chunk == MAP_FAILED) abort(); - memset(new_chunk, 0, new_chunk_len); - new_chunk->data_len = - new_chunk_len - sizeof(struct registry_chunk); + memset(new_chunk, 0, new_chunk_size_bytes); + new_chunk->capacity = new_capacity; cds_list_add_tail(&new_chunk->node, &arena->chunk_list); } @@ -439,22 +433,23 @@ static struct rcu_reader *arena_alloc(struct registry_arena *arena) { struct registry_chunk *chunk; - struct rcu_reader *rcu_reader_reg; int expand_done = 0; /* Only allow to expand once per alloc */ - size_t len = sizeof(struct rcu_reader); retry: cds_list_for_each_entry(chunk, &arena->chunk_list, node) { - if (chunk->data_len - chunk->used < len) + size_t spot_idx; + + /* Skip fully used chunks. */ + if (chunk->used == chunk->capacity) { continue; - /* Find spot */ - for (rcu_reader_reg = (struct rcu_reader *) &chunk->data[0]; - rcu_reader_reg < (struct rcu_reader *) &chunk->data[chunk->data_len]; - rcu_reader_reg++) { - if (!rcu_reader_reg->alloc) { - rcu_reader_reg->alloc = 1; - chunk->used += len; - return rcu_reader_reg; + } + + /* Find a spot. */ + for (spot_idx = 0; spot_idx < chunk->capacity; spot_idx++) { + if (!chunk->readers[spot_idx].alloc) { + chunk->readers[spot_idx].alloc = 1; + chunk->used++; + return &chunk->readers[spot_idx]; } } } @@ -502,7 +497,7 @@ void cleanup_thread(struct registry_chunk *chunk, cds_list_del(&rcu_reader_reg->node); rcu_reader_reg->tid = 0; rcu_reader_reg->alloc = 0; - chunk->used -= sizeof(struct rcu_reader); + chunk->used--; } static @@ -511,9 +506,9 @@ struct registry_chunk *find_chunk(struct rcu_reader *rcu_reader_reg) struct registry_chunk *chunk; cds_list_for_each_entry(chunk, ®istry_arena.chunk_list, node) { - if (rcu_reader_reg < (struct rcu_reader *) &chunk->data[0]) + if (rcu_reader_reg < (struct urcu_bp_reader *) &chunk->readers[0]) continue; - if (rcu_reader_reg >= (struct rcu_reader *) &chunk->data[chunk->data_len]) + if (rcu_reader_reg >= (struct urcu_bp_reader *) &chunk->readers[chunk->capacity]) continue; return chunk; } @@ -662,8 +657,7 @@ void urcu_bp_exit(void) cds_list_for_each_entry_safe(chunk, tmp, ®istry_arena.chunk_list, node) { - munmap((void *) chunk, chunk->data_len - + sizeof(struct registry_chunk)); + munmap((void *) chunk, chunk_allocation_size(chunk->capacity)); } CDS_INIT_LIST_HEAD(®istry_arena.chunk_list); ret = pthread_key_delete(urcu_bp_key); @@ -673,6 +667,13 @@ void urcu_bp_exit(void) mutex_unlock(&init_lock); } +static +void urcu_bp_exit_destructor(void) +{ + urcu_call_rcu_exit(); + urcu_bp_exit(); +} + /* * Holding the rcu_gp_lock and rcu_registry_lock across fork will make * sure we fork() don't race with a concurrent thread executing with @@ -713,17 +714,18 @@ static void urcu_bp_prune_registry(void) { struct registry_chunk *chunk; - struct urcu_bp_reader *rcu_reader_reg; cds_list_for_each_entry(chunk, ®istry_arena.chunk_list, node) { - for (rcu_reader_reg = (struct urcu_bp_reader *) &chunk->data[0]; - rcu_reader_reg < (struct urcu_bp_reader *) &chunk->data[chunk->data_len]; - rcu_reader_reg++) { - if (!rcu_reader_reg->alloc) + size_t spot_idx; + + for (spot_idx = 0; spot_idx < chunk->capacity; spot_idx++) { + struct urcu_bp_reader *reader = &chunk->readers[spot_idx]; + + if (!reader->alloc) continue; - if (rcu_reader_reg->tid == pthread_self()) + if (reader->tid == pthread_self()) continue; - cleanup_thread(chunk, rcu_reader_reg); + cleanup_thread(chunk, reader); } } } @@ -769,3 +771,4 @@ DEFINE_RCU_FLAVOR(rcu_flavor); #include "urcu-call-rcu-impl.h" #include "urcu-defer-impl.h" +#include "urcu-poll-impl.h" diff --git a/src/urcu-call-rcu-impl.h b/src/urcu-call-rcu-impl.h index 4392bc6..2ea1efc 100644 --- a/src/urcu-call-rcu-impl.h +++ b/src/urcu-call-rcu-impl.h @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu-call-rcu.c - * * Userspace RCU library - batch memory reclamation with kernel API - * - * Copyright (c) 2010 Paul E. McKenney - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _LGPL_SOURCE @@ -44,6 +30,7 @@ #include #include "urcu-die.h" #include "urcu-utils.h" +#include "compat-smp.h" #define SET_AFFINITY_CHECK_PERIOD (1U << 8) /* 256 */ #define SET_AFFINITY_CHECK_PERIOD_MASK (SET_AFFINITY_CHECK_PERIOD - 1) @@ -80,6 +67,10 @@ struct call_rcu_completion_work { struct call_rcu_completion *completion; }; +enum crdf_flags { + CRDF_FLAG_JOIN_THREAD = (1 << 0), +}; + /* * List of all call_rcu_data structures to keep valgrind happy. * Protected by call_rcu_mutex. @@ -101,7 +92,6 @@ static pthread_mutex_t call_rcu_mutex = PTHREAD_MUTEX_INITIALIZER; static struct call_rcu_data *default_call_rcu_data; static struct urcu_atfork *registered_rculfhash_atfork; -static unsigned long registered_rculfhash_atfork_refcount; /* * If the sched_getcpu() and sysconf(_SC_NPROCESSORS_CONF) calls are @@ -120,11 +110,11 @@ static unsigned long registered_rculfhash_atfork_refcount; */ static struct call_rcu_data **per_cpu_call_rcu_data; -static long maxcpus; +static long cpus_array_len; -static void maxcpus_reset(void) +static void cpus_array_len_reset(void) { - maxcpus = 0; + cpus_array_len = 0; } /* Allocate the array if it has not already been allocated. */ @@ -134,15 +124,15 @@ static void alloc_cpu_call_rcu_data(void) struct call_rcu_data **p; static int warned = 0; - if (maxcpus != 0) + if (cpus_array_len != 0) return; - maxcpus = sysconf(_SC_NPROCESSORS_CONF); - if (maxcpus <= 0) { + cpus_array_len = get_possible_cpus_array_len(); + if (cpus_array_len <= 0) { return; } - p = malloc(maxcpus * sizeof(*per_cpu_call_rcu_data)); + p = malloc(cpus_array_len * sizeof(*per_cpu_call_rcu_data)); if (p != NULL) { - memset(p, '\0', maxcpus * sizeof(*per_cpu_call_rcu_data)); + memset(p, '\0', cpus_array_len * sizeof(*per_cpu_call_rcu_data)); rcu_set_pointer(&per_cpu_call_rcu_data, p); } else { if (!warned) { @@ -160,9 +150,9 @@ static void alloc_cpu_call_rcu_data(void) * constant. */ static struct call_rcu_data **per_cpu_call_rcu_data = NULL; -static const long maxcpus = -1; +static const long cpus_array_len = -1; -static void maxcpus_reset(void) +static void cpus_array_len_reset(void) { } @@ -240,17 +230,25 @@ static void call_rcu_wait(struct call_rcu_data *crdp) { /* Read call_rcu list before read futex */ cmm_smp_mb(); - if (uatomic_read(&crdp->futex) != -1) - return; - while (futex_async(&crdp->futex, FUTEX_WAIT, -1, - NULL, NULL, 0)) { + while (uatomic_read(&crdp->futex) == -1) { + if (!futex_async(&crdp->futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ return; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -274,17 +272,25 @@ static void call_rcu_completion_wait(struct call_rcu_completion *completion) { /* Read completion barrier count before read futex */ cmm_smp_mb(); - if (uatomic_read(&completion->futex) != -1) - return; - while (futex_async(&completion->futex, FUTEX_WAIT, -1, - NULL, NULL, 0)) { + while (uatomic_read(&completion->futex) == -1) { + if (!futex_async(&completion->futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ return; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -417,6 +423,7 @@ static void call_rcu_data_init(struct call_rcu_data **crdpp, { struct call_rcu_data *crdp; int ret; + sigset_t newmask, oldmask; crdp = malloc(sizeof(*crdp)); if (crdp == NULL) @@ -429,11 +436,19 @@ static void call_rcu_data_init(struct call_rcu_data **crdpp, cds_list_add(&crdp->list, &call_rcu_data_list); crdp->cpu_affinity = cpu_affinity; crdp->gp_count = 0; - cmm_smp_mb(); /* Structure initialized before pointer is planted. */ - *crdpp = crdp; + rcu_set_pointer(crdpp, crdp); + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); + ret = pthread_create(&crdp->tid, NULL, call_rcu_thread, crdp); if (ret) urcu_die(ret); + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); + urcu_posix_assert(!ret); } /* @@ -454,11 +469,11 @@ struct call_rcu_data *get_cpu_call_rcu_data(int cpu) pcpu_crdp = rcu_dereference(per_cpu_call_rcu_data); if (pcpu_crdp == NULL) return NULL; - if (!warned && maxcpus > 0 && (cpu < 0 || maxcpus <= cpu)) { + if (!warned && cpus_array_len > 0 && (cpu < 0 || cpus_array_len <= cpu)) { fprintf(stderr, "[error] liburcu: get CPU # out of range\n"); warned = 1; } - if (cpu < 0 || maxcpus <= cpu) + if (cpu < 0 || cpus_array_len <= cpu) return NULL; return rcu_dereference(pcpu_crdp[cpu]); } @@ -516,7 +531,7 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp) call_rcu_lock(&call_rcu_mutex); alloc_cpu_call_rcu_data(); - if (cpu < 0 || maxcpus <= cpu) { + if (cpu < 0 || cpus_array_len <= cpu) { if (!warned) { fprintf(stderr, "[error] liburcu: set CPU # out of range\n"); warned = 1; @@ -545,22 +560,27 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp) /* * Return a pointer to the default call_rcu_data structure, creating - * one if need be. Because we never free call_rcu_data structures, - * we don't need to be in an RCU read-side critical section. + * one if need be. + * + * The call to this function with intent to use the returned + * call_rcu_data should be protected by RCU read-side lock. */ struct call_rcu_data *get_default_call_rcu_data(void) { - if (default_call_rcu_data != NULL) - return rcu_dereference(default_call_rcu_data); + struct call_rcu_data *crdp; + + crdp = rcu_dereference(default_call_rcu_data); + if (crdp != NULL) + return crdp; + call_rcu_lock(&call_rcu_mutex); - if (default_call_rcu_data != NULL) { - call_rcu_unlock(&call_rcu_mutex); - return default_call_rcu_data; - } - call_rcu_data_init(&default_call_rcu_data, 0, -1); + if (default_call_rcu_data == NULL) + call_rcu_data_init(&default_call_rcu_data, 0, -1); + crdp = default_call_rcu_data; call_rcu_unlock(&call_rcu_mutex); - return default_call_rcu_data; + + return crdp; } /* @@ -581,7 +601,7 @@ struct call_rcu_data *get_call_rcu_data(void) if (URCU_TLS(thread_call_rcu_data) != NULL) return URCU_TLS(thread_call_rcu_data); - if (maxcpus > 0) { + if (cpus_array_len > 0) { crd = get_cpu_call_rcu_data(urcu_sched_getcpu()); if (crd) return crd; @@ -632,7 +652,7 @@ int create_all_cpu_call_rcu_data(unsigned long flags) call_rcu_lock(&call_rcu_mutex); alloc_cpu_call_rcu_data(); call_rcu_unlock(&call_rcu_mutex); - if (maxcpus <= 0) { + if (cpus_array_len <= 0) { errno = EINVAL; return -EINVAL; } @@ -640,7 +660,7 @@ int create_all_cpu_call_rcu_data(unsigned long flags) errno = ENOMEM; return -ENOMEM; } - for (i = 0; i < maxcpus; i++) { + for (i = 0; i < cpus_array_len; i++) { call_rcu_lock(&call_rcu_mutex); if (get_cpu_call_rcu_data(i)) { call_rcu_unlock(&call_rcu_mutex); @@ -739,7 +759,8 @@ void call_rcu(struct rcu_head *head, * a list corruption bug in the 0.7.x series. The equivalent fix * appeared in 0.6.8 for the stable-0.6 branch. */ -void call_rcu_data_free(struct call_rcu_data *crdp) +static +void _call_rcu_data_free(struct call_rcu_data *crdp, unsigned int flags) { if (crdp == NULL || crdp == default_call_rcu_data) { return; @@ -768,9 +789,21 @@ void call_rcu_data_free(struct call_rcu_data *crdp) cds_list_del(&crdp->list); call_rcu_unlock(&call_rcu_mutex); + if (flags & CRDF_FLAG_JOIN_THREAD) { + int ret; + + ret = pthread_join(get_call_rcu_thread(crdp), NULL); + if (ret) + urcu_die(ret); + } free(crdp); } +void call_rcu_data_free(struct call_rcu_data *crdp) +{ + _call_rcu_data_free(crdp, CRDF_FLAG_JOIN_THREAD); +} + /* * Clean up all the per-CPU call_rcu threads. */ @@ -780,10 +813,10 @@ void free_all_cpu_call_rcu_data(void) struct call_rcu_data **crdp; static int warned = 0; - if (maxcpus <= 0) + if (cpus_array_len <= 0) return; - crdp = malloc(sizeof(*crdp) * maxcpus); + crdp = malloc(sizeof(*crdp) * cpus_array_len); if (!crdp) { if (!warned) { fprintf(stderr, "[error] liburcu: unable to allocate per-CPU pointer array\n"); @@ -792,7 +825,7 @@ void free_all_cpu_call_rcu_data(void) return; } - for (cpu = 0; cpu < maxcpus; cpu++) { + for (cpu = 0; cpu < cpus_array_len; cpu++) { crdp[cpu] = get_cpu_call_rcu_data(cpu); if (crdp[cpu] == NULL) continue; @@ -803,7 +836,7 @@ void free_all_cpu_call_rcu_data(void) * call_rcu_data to become quiescent. */ synchronize_rcu(); - for (cpu = 0; cpu < maxcpus; cpu++) { + for (cpu = 0; cpu < cpus_array_len; cpu++) { if (crdp[cpu] == NULL) continue; call_rcu_data_free(crdp[cpu]); @@ -862,7 +895,7 @@ void rcu_barrier(void) goto online; } - completion = calloc(sizeof(*completion), 1); + completion = calloc(1, sizeof(*completion)); if (!completion) urcu_die(errno); @@ -877,7 +910,7 @@ void rcu_barrier(void) cds_list_for_each_entry(crdp, &call_rcu_data_list, list) { struct call_rcu_completion_work *work; - work = calloc(sizeof(*work), 1); + work = calloc(1, sizeof(*work)); if (!work) urcu_die(errno); work->completion = completion; @@ -981,7 +1014,7 @@ void call_rcu_after_fork_child(void) (void)get_default_call_rcu_data(); /* Cleanup call_rcu_data pointers before use */ - maxcpus_reset(); + cpus_array_len_reset(); free(per_cpu_call_rcu_data); rcu_set_pointer(&per_cpu_call_rcu_data, NULL); URCU_TLS(thread_call_rcu_data) = NULL; @@ -995,26 +1028,85 @@ void call_rcu_after_fork_child(void) if (crdp == default_call_rcu_data) continue; uatomic_set(&crdp->flags, URCU_CALL_RCU_STOPPED); - call_rcu_data_free(crdp); + /* + * Do not join the thread because it does not exist in + * the child. + */ + _call_rcu_data_free(crdp, 0); } } void urcu_register_rculfhash_atfork(struct urcu_atfork *atfork) { + if (CMM_LOAD_SHARED(registered_rculfhash_atfork)) + return; call_rcu_lock(&call_rcu_mutex); - if (registered_rculfhash_atfork_refcount++) - goto end; - registered_rculfhash_atfork = atfork; -end: + if (!registered_rculfhash_atfork) + registered_rculfhash_atfork = atfork; call_rcu_unlock(&call_rcu_mutex); } +/* + * This unregistration function is deprecated, meant only for internal + * use by rculfhash. + */ +__attribute__((__noreturn__)) void urcu_unregister_rculfhash_atfork(struct urcu_atfork *atfork __attribute__((unused))) { + urcu_die(EPERM); +} + +/* + * Teardown the default call_rcu worker thread if there are no queued + * callbacks on process exit. This prevents leaking memory. + * + * Here is how an application can ensure graceful teardown of this + * worker thread: + * + * - An application queuing call_rcu callbacks should invoke + * rcu_barrier() before it exits. + * - When chaining call_rcu callbacks, the number of calls to + * rcu_barrier() on application exit must match at least the maximum + * number of chained callbacks. + * - If an application chains callbacks endlessly, it would have to be + * modified to stop chaining callbacks when it detects an application + * exit (e.g. with a flag), and wait for quiescence with rcu_barrier() + * after setting that flag. + * - The statements above apply to a library which queues call_rcu + * callbacks, only it needs to invoke rcu_barrier in its library + * destructor. + * + * Note that this function does not presume it is being called when the + * application is single-threaded even though this is invoked from a + * destructor: this function synchronizes against concurrent calls to + * get_default_call_rcu_data(). + */ +static void urcu_call_rcu_exit(void) +{ + struct call_rcu_data *crdp; + bool teardown = true; + + if (default_call_rcu_data == NULL) + return; call_rcu_lock(&call_rcu_mutex); - if (--registered_rculfhash_atfork_refcount) - goto end; - registered_rculfhash_atfork = NULL; -end: + /* + * If the application leaves callbacks in the default call_rcu + * worker queue, keep the default worker in place. + */ + crdp = default_call_rcu_data; + if (!crdp) { + teardown = false; + goto unlock; + } + if (!cds_wfcq_empty(&crdp->cbs_head, &crdp->cbs_tail)) { + teardown = false; + goto unlock; + } + rcu_set_pointer(&default_call_rcu_data, NULL); +unlock: call_rcu_unlock(&call_rcu_mutex); + if (teardown) { + synchronize_rcu(); + call_rcu_data_free(crdp); + } } diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index d25e9b9..a180c48 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -1,31 +1,17 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_DEFER_IMPL_H #define _URCU_DEFER_IMPL_H /* - * urcu-defer-impl.h - * * Userspace RCU header - memory reclamation. * * TO BE INCLUDED ONLY FROM URCU LIBRARY CODE. See urcu-defer.h for linking * dynamically with the userspace rcu reclamation library. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -194,17 +180,25 @@ static void wait_defer(void) uatomic_set(&defer_thread_futex, 0); } else { cmm_smp_rmb(); /* Read queue before read futex */ - if (uatomic_read(&defer_thread_futex) != -1) - return; - while (futex_noasync(&defer_thread_futex, FUTEX_WAIT, -1, - NULL, NULL, 0)) { + while (uatomic_read(&defer_thread_futex) == -1) { + if (!futex_noasync(&defer_thread_futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ return; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -401,8 +395,18 @@ void defer_rcu(void (*fct)(void *p), void *p) static void start_defer_thread(void) { int ret; + sigset_t newmask, oldmask; + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); ret = pthread_create(&tid_defer, NULL, thr_defer, NULL); + if (ret) + urcu_die(ret); + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); urcu_posix_assert(!ret); } diff --git a/src/urcu-die.h b/src/urcu-die.h index 227c8dc..d6b0b16 100644 --- a/src/urcu-die.h +++ b/src/urcu-die.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_DIE_H #define _URCU_DIE_H /* - * urcu-die.h - * * Userspace RCU library unrecoverable error handling - * - * Copyright (c) 2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/src/urcu-pointer.c b/src/urcu-pointer.c index d0854ac..a42fe87 100644 --- a/src/urcu-pointer.c +++ b/src/urcu-pointer.c @@ -1,26 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later /* - * urcu-pointer.c - * * library wrappers to be used by non-LGPL compatible source code. * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -39,19 +24,16 @@ void *rcu_dereference_sym(void *p) void *rcu_set_pointer_sym(void **p, void *v) { - cmm_wmb(); - uatomic_set(p, v); + uatomic_store(p, v, CMM_RELEASE); return v; } void *rcu_xchg_pointer_sym(void **p, void *v) { - cmm_wmb(); - return uatomic_xchg(p, v); + return uatomic_xchg_mo(p, v, CMM_SEQ_CST); } void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) { - cmm_wmb(); - return uatomic_cmpxchg(p, old, _new); + return uatomic_cmpxchg_mo(p, old, _new, CMM_SEQ_CST, CMM_RELAXED); } diff --git a/src/urcu-poll-impl.h b/src/urcu-poll-impl.h new file mode 100644 index 0000000..9aaf5eb --- /dev/null +++ b/src/urcu-poll-impl.h @@ -0,0 +1,86 @@ +// SPDX-FileCopyrightText: 2023 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +/* + * Userspace RCU library - Grace period polling API + */ + +#include +#include + +#include +#include + +struct urcu_poll_worker_state { + struct urcu_gp_poll_state current_state; + struct urcu_gp_poll_state latest_target; /* Most recent snapshot taken */ + struct rcu_head rcu_head; + pthread_mutex_t lock; + bool active; +}; + +static struct urcu_poll_worker_state poll_worker_gp_state = { + .lock = PTHREAD_MUTEX_INITIALIZER, +}; + +static +void urcu_poll_worker_cb(struct rcu_head *head __attribute__((unused))) +{ + mutex_lock(&poll_worker_gp_state.lock); + /* A new grace period has been reached. */ + poll_worker_gp_state.current_state.grace_period_id++; + if ((long)(poll_worker_gp_state.latest_target.grace_period_id - poll_worker_gp_state.current_state.grace_period_id) >= 0) { + /* Need to re-queue. */ + call_rcu(&poll_worker_gp_state.rcu_head, urcu_poll_worker_cb); + } else { + /* No user waiting for a target grace period. */ + poll_worker_gp_state.active = false; + } + mutex_unlock(&poll_worker_gp_state.lock); +} + +/* + * Start polling on grace period. If no worker is currently active, + * snapshot the current value and start a worker callback. If the worker + * is currently active, snapshot the current value + 1, and set this + * value as the latest snapshot, which will cause the worker to re-queue + * itself with call_rcu to issue one more grace period. + * + * Because it uses call_rcu, it needs to be called from a registered RCU + * thread. + */ +struct urcu_gp_poll_state start_poll_synchronize_rcu(void) +{ + struct urcu_gp_poll_state new_target_gp_state; + bool was_active = false; + + mutex_lock(&poll_worker_gp_state.lock); + new_target_gp_state.grace_period_id = poll_worker_gp_state.current_state.grace_period_id; + was_active = poll_worker_gp_state.active; + if (!was_active) + poll_worker_gp_state.active = true; + else + new_target_gp_state.grace_period_id++; + poll_worker_gp_state.latest_target.grace_period_id = new_target_gp_state.grace_period_id; + if (!was_active) + call_rcu(&poll_worker_gp_state.rcu_head, urcu_poll_worker_cb); + mutex_unlock(&poll_worker_gp_state.lock); + return new_target_gp_state; +} + +/* + * Poll the grace period state. Return true if quiescence was reached + * since the snapshot was taken, return false if quiescence was not + * reached since snapshot. + */ +bool poll_state_synchronize_rcu(struct urcu_gp_poll_state target_gp_state) +{ + bool target_gp_reached = false; + + mutex_lock(&poll_worker_gp_state.lock); + if ((long)(target_gp_state.grace_period_id - poll_worker_gp_state.current_state.grace_period_id) < 0) + target_gp_reached = true; + mutex_unlock(&poll_worker_gp_state.lock); + return target_gp_reached; +} diff --git a/src/urcu-qsbr.c b/src/urcu-qsbr.c index d69d93b..e7ee180 100644 --- a/src/urcu-qsbr.c +++ b/src/urcu-qsbr.c @@ -1,25 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu-qsbr.c - * * Userspace RCU QSBR library * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -34,6 +20,7 @@ #include #include +#include #include #include #include @@ -53,6 +40,7 @@ #define _LGPL_SOURCE void __attribute__((destructor)) urcu_qsbr_exit(void); +static void urcu_call_rcu_exit(void); /* * rcu_gp_lock ensures mutual exclusion between threads calling @@ -123,17 +111,25 @@ static void wait_gp(void) { /* Read reader_gp before read futex */ cmm_smp_rmb(); - if (uatomic_read(&urcu_qsbr_gp.futex) != -1) - return; - while (futex_noasync(&urcu_qsbr_gp.futex, FUTEX_WAIT, -1, - NULL, NULL, 0)) { + while (uatomic_read(&urcu_qsbr_gp.futex) == -1) { + if (!futex_noasync(&urcu_qsbr_gp.futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ return; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -147,7 +143,8 @@ static void wait_gp(void) */ static void wait_for_readers(struct cds_list_head *input_readers, struct cds_list_head *cur_snap_readers, - struct cds_list_head *qsreaders) + struct cds_list_head *qsreaders, + cmm_annotate_t *group) { unsigned int wait_loops = 0; struct urcu_qsbr_reader *index, *tmp; @@ -174,7 +171,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, cmm_smp_mb(); } cds_list_for_each_entry_safe(index, tmp, input_readers, node) { - switch (urcu_qsbr_reader_state(&index->ctr)) { + switch (urcu_qsbr_reader_state(&index->ctr, group)) { case URCU_READER_ACTIVE_CURRENT: if (cur_snap_readers) { cds_list_move(&index->node, @@ -199,8 +196,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, if (cds_list_empty(input_readers)) { if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { /* Read reader_gp before write futex */ - cmm_smp_mb(); - uatomic_set(&urcu_qsbr_gp.futex, 0); + uatomic_store(&urcu_qsbr_gp.futex, 0, CMM_RELEASE); } break; } else { @@ -229,6 +225,8 @@ static void wait_for_readers(struct cds_list_head *input_readers, #if (CAA_BITS_PER_LONG < 64) void urcu_qsbr_synchronize_rcu(void) { + cmm_annotate_define(acquire_group); + cmm_annotate_define(release_group); CDS_LIST_HEAD(cur_snap_readers); CDS_LIST_HEAD(qsreaders); unsigned long was_online; @@ -249,6 +247,7 @@ void urcu_qsbr_synchronize_rcu(void) urcu_qsbr_thread_offline(); else cmm_smp_mb(); + cmm_annotate_group_mb_release(&release_group); /* * Add ourself to gp_waiters queue of threads awaiting to wait @@ -280,7 +279,7 @@ void urcu_qsbr_synchronize_rcu(void) * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(®istry, &cur_snap_readers, &qsreaders); + wait_for_readers(®istry, &cur_snap_readers, &qsreaders, &acquire_group); /* * Must finish waiting for quiescent state for original parity @@ -300,7 +299,8 @@ void urcu_qsbr_synchronize_rcu(void) cmm_smp_mb(); /* Switch parity: 0 -> 1, 1 -> 0 */ - CMM_STORE_SHARED(urcu_qsbr_gp.ctr, urcu_qsbr_gp.ctr ^ URCU_QSBR_GP_CTR); + cmm_annotate_group_mem_release(&release_group, &urcu_qsbr_gp.ctr); + uatomic_store(&urcu_qsbr_gp.ctr, urcu_qsbr_gp.ctr ^ URCU_QSBR_GP_CTR, CMM_RELAXED); /* * Must commit urcu_qsbr_gp.ctr update to memory before waiting for @@ -323,7 +323,7 @@ void urcu_qsbr_synchronize_rcu(void) * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(&cur_snap_readers, NULL, &qsreaders); + wait_for_readers(&cur_snap_readers, NULL, &qsreaders, &acquire_group); /* * Put quiescent reader list back into registry. @@ -338,6 +338,8 @@ gp_end: * Finish waiting for reader threads before letting the old ptr being * freed. */ + cmm_annotate_group_mb_acquire(&acquire_group); + if (was_online) urcu_qsbr_thread_online(); else @@ -346,6 +348,8 @@ gp_end: #else /* !(CAA_BITS_PER_LONG < 64) */ void urcu_qsbr_synchronize_rcu(void) { + cmm_annotate_define(acquire_group); + cmm_annotate_define(release_group); CDS_LIST_HEAD(qsreaders); unsigned long was_online; DEFINE_URCU_WAIT_NODE(wait, URCU_WAIT_WAITING); @@ -362,6 +366,7 @@ void urcu_qsbr_synchronize_rcu(void) urcu_qsbr_thread_offline(); else cmm_smp_mb(); + cmm_annotate_group_mb_release(&release_group); /* * Add ourself to gp_waiters queue of threads awaiting to wait @@ -389,7 +394,8 @@ void urcu_qsbr_synchronize_rcu(void) goto out; /* Increment current G.P. */ - CMM_STORE_SHARED(urcu_qsbr_gp.ctr, urcu_qsbr_gp.ctr + URCU_QSBR_GP_CTR); + cmm_annotate_group_mem_release(&release_group, &urcu_qsbr_gp.ctr); + uatomic_store(&urcu_qsbr_gp.ctr, urcu_qsbr_gp.ctr + URCU_QSBR_GP_CTR, CMM_RELAXED); /* * Must commit urcu_qsbr_gp.ctr update to memory before waiting for @@ -412,7 +418,7 @@ void urcu_qsbr_synchronize_rcu(void) * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(®istry, NULL, &qsreaders); + wait_for_readers(®istry, NULL, &qsreaders, &acquire_group); /* * Put quiescent reader list back into registry. @@ -427,6 +433,8 @@ gp_end: urcu_qsbr_thread_online(); else cmm_smp_mb(); + + cmm_annotate_group_mb_acquire(&acquire_group); } #endif /* !(CAA_BITS_PER_LONG < 64) */ @@ -501,9 +509,11 @@ void urcu_qsbr_exit(void) * readers, and left running at exit. * urcu_posix_assert(cds_list_empty(®istry)); */ + urcu_call_rcu_exit(); } DEFINE_RCU_FLAVOR(rcu_flavor); #include "urcu-call-rcu-impl.h" #include "urcu-defer-impl.h" +#include "urcu-poll-impl.h" diff --git a/src/urcu-utils.h b/src/urcu-utils.h index af03675..face655 100644 --- a/src/urcu-utils.h +++ b/src/urcu-utils.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2018 Michael Jeanson +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_UTILS_H #define _URCU_UTILS_H /* - * urcu-utils.h - * * Userspace RCU library internal utils - * - * Copyright (c) 2018 Michael Jeanson - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/src/urcu-wait.h b/src/urcu-wait.h index c586ec9..d77282b 100644 --- a/src/urcu-wait.h +++ b/src/urcu-wait.h @@ -1,31 +1,18 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WAIT_H #define _URCU_WAIT_H /* - * urcu-wait.h - * * Userspace RCU library wait/wakeup management - * - * Copyright (c) 2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include +#include #include "urcu-die.h" /* @@ -49,7 +36,7 @@ struct urcu_wait_node { }; #define URCU_WAIT_NODE_INIT(name, _state) \ - { .state = _state } + { .node = { .next = NULL }, .state = _state } #define DEFINE_URCU_WAIT_NODE(name, state) \ struct urcu_wait_node name = URCU_WAIT_NODE_INIT(name, state) @@ -126,16 +113,15 @@ void urcu_wait_node_init(struct urcu_wait_node *node, static inline void urcu_adaptative_wake_up(struct urcu_wait_node *wait) { - cmm_smp_mb(); urcu_posix_assert(uatomic_read(&wait->state) == URCU_WAIT_WAITING); - uatomic_set(&wait->state, URCU_WAIT_WAKEUP); + uatomic_store(&wait->state, URCU_WAIT_WAKEUP, CMM_RELEASE); if (!(uatomic_read(&wait->state) & URCU_WAIT_RUNNING)) { if (futex_noasync(&wait->state, FUTEX_WAKE, 1, NULL, NULL, 0) < 0) urcu_die(errno); } /* Allow teardown of struct urcu_wait memory. */ - uatomic_or(&wait->state, URCU_WAIT_TEARDOWN); + uatomic_or_mo(&wait->state, URCU_WAIT_TEARDOWN, CMM_RELEASE); } /* @@ -150,19 +136,30 @@ void urcu_adaptative_busy_wait(struct urcu_wait_node *wait) /* Load and test condition before read state */ cmm_smp_rmb(); for (i = 0; i < URCU_WAIT_ATTEMPTS; i++) { - if (uatomic_read(&wait->state) != URCU_WAIT_WAITING) + if (uatomic_load(&wait->state, CMM_ACQUIRE) != URCU_WAIT_WAITING) goto skip_futex_wait; caa_cpu_relax(); } - while (futex_noasync(&wait->state, FUTEX_WAIT, URCU_WAIT_WAITING, - NULL, NULL, 0)) { + while (uatomic_load(&wait->state, CMM_ACQUIRE) == URCU_WAIT_WAITING) { + if (!futex_noasync(&wait->state, FUTEX_WAIT, URCU_WAIT_WAITING, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * URCU_WAIT_WAITING (spurious wakeups). Check + * the value again in user-space to validate + * whether it really differs from + * URCU_WAIT_WAITING. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ goto skip_futex_wait; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -178,11 +175,11 @@ skip_futex_wait: * memory allocated for struct urcu_wait. */ for (i = 0; i < URCU_WAIT_ATTEMPTS; i++) { - if (uatomic_read(&wait->state) & URCU_WAIT_TEARDOWN) + if (uatomic_load(&wait->state, CMM_RELAXED) & URCU_WAIT_TEARDOWN) break; caa_cpu_relax(); } - while (!(uatomic_read(&wait->state) & URCU_WAIT_TEARDOWN)) + while (!(uatomic_load(&wait->state, CMM_ACQUIRE) & URCU_WAIT_TEARDOWN)) poll(NULL, 0, 10); urcu_posix_assert(uatomic_read(&wait->state) & URCU_WAIT_TEARDOWN); } @@ -198,7 +195,7 @@ void urcu_wake_all_waiters(struct urcu_waiters *waiters) caa_container_of(iter, struct urcu_wait_node, node); /* Don't wake already running threads */ - if (wait_node->state & URCU_WAIT_RUNNING) + if (uatomic_load(&wait_node->state, CMM_RELAXED) & URCU_WAIT_RUNNING) continue; urcu_adaptative_wake_up(wait_node); } diff --git a/src/urcu.c b/src/urcu.c index 67c6525..5f4a7d7 100644 --- a/src/urcu.c +++ b/src/urcu.c @@ -1,25 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * urcu.c - * * Userspace RCU library * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -38,6 +24,7 @@ #include #include +#include #include #include #include @@ -99,18 +86,14 @@ int urcu_memb_has_sys_membarrier = 0; void __attribute__((constructor)) rcu_init(void); #endif -#ifdef RCU_MB +#if defined(RCU_MB) void rcu_init(void) { } #endif -#ifdef RCU_SIGNAL -static int init_done; - -void __attribute__((constructor)) rcu_init(void); void __attribute__((destructor)) rcu_exit(void); -#endif +static void urcu_call_rcu_exit(void); /* * rcu_gp_lock ensures mutual exclusion between threads calling @@ -188,62 +171,13 @@ static void smp_mb_master(void) } #endif -#ifdef RCU_MB +#if defined(RCU_MB) static void smp_mb_master(void) { cmm_smp_mb(); } #endif -#ifdef RCU_SIGNAL -static void force_mb_all_readers(void) -{ - struct urcu_reader *index; - - /* - * Ask for each threads to execute a cmm_smp_mb() so we can consider the - * compiler barriers around rcu read lock as real memory barriers. - */ - if (cds_list_empty(®istry)) - return; - /* - * pthread_kill has a cmm_smp_mb(). But beware, we assume it performs - * a cache flush on architectures with non-coherent cache. Let's play - * safe and don't assume anything : we use cmm_smp_mc() to make sure the - * cache flush is enforced. - */ - cds_list_for_each_entry(index, ®istry, node) { - CMM_STORE_SHARED(index->need_mb, 1); - pthread_kill(index->tid, SIGRCU); - } - /* - * Wait for sighandler (and thus mb()) to execute on every thread. - * - * Note that the pthread_kill() will never be executed on systems - * that correctly deliver signals in a timely manner. However, it - * is not uncommon for kernels to have bugs that can result in - * lost or unduly delayed signals. - * - * If you are seeing the below pthread_kill() executing much at - * all, we suggest testing the underlying kernel and filing the - * relevant bug report. For Linux kernels, we recommend getting - * the Linux Test Project (LTP). - */ - cds_list_for_each_entry(index, ®istry, node) { - while (CMM_LOAD_SHARED(index->need_mb)) { - pthread_kill(index->tid, SIGRCU); - (void) poll(NULL, 0, 1); - } - } - cmm_smp_mb(); /* read ->need_mb before ending the barrier */ -} - -static void smp_mb_master(void) -{ - force_mb_all_readers(); -} -#endif /* #ifdef RCU_SIGNAL */ - /* * synchronize_rcu() waiting. Single thread. * Always called with rcu_registry lock held. Releases this lock and @@ -252,24 +186,30 @@ static void smp_mb_master(void) static void wait_gp(void) { /* - * Read reader_gp before read futex. smp_mb_master() needs to - * be called with the rcu registry lock held in RCU_SIGNAL - * flavor. + * Read reader_gp before read futex. */ smp_mb_master(); /* Temporarily unlock the registry lock. */ mutex_unlock(&rcu_registry_lock); - if (uatomic_read(&rcu_gp.futex) != -1) - goto end; - while (futex_async(&rcu_gp.futex, FUTEX_WAIT, -1, - NULL, NULL, 0)) { + while (uatomic_read(&rcu_gp.futex) == -1) { + if (!futex_async(&rcu_gp.futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ goto end; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -288,7 +228,8 @@ end: */ static void wait_for_readers(struct cds_list_head *input_readers, struct cds_list_head *cur_snap_readers, - struct cds_list_head *qsreaders) + struct cds_list_head *qsreaders, + cmm_annotate_t *group) { unsigned int wait_loops = 0; struct urcu_reader *index, *tmp; @@ -311,7 +252,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, } cds_list_for_each_entry_safe(index, tmp, input_readers, node) { - switch (urcu_common_reader_state(&rcu_gp, &index->ctr)) { + switch (urcu_common_reader_state(&rcu_gp, &index->ctr, group)) { case URCU_READER_ACTIVE_CURRENT: if (cur_snap_readers) { cds_list_move(&index->node, @@ -395,6 +336,8 @@ static void wait_for_readers(struct cds_list_head *input_readers, void synchronize_rcu(void) { + cmm_annotate_define(acquire_group); + cmm_annotate_define(release_group); CDS_LIST_HEAD(cur_snap_readers); CDS_LIST_HEAD(qsreaders); DEFINE_URCU_WAIT_NODE(wait, URCU_WAIT_WAITING); @@ -409,10 +352,11 @@ void synchronize_rcu(void) * queue before their insertion into the wait queue. */ if (urcu_wait_add(&gp_waiters, &wait) != 0) { - /* Not first in queue: will be awakened by another thread. */ + /* + * Not first in queue: will be awakened by another thread. + * Implies a memory barrier after grace period. + */ urcu_adaptative_busy_wait(&wait); - /* Order following memory accesses after grace period. */ - cmm_smp_mb(); return; } /* We won't need to wake ourself up */ @@ -437,13 +381,14 @@ void synchronize_rcu(void) */ /* Write new ptr before changing the qparity */ smp_mb_master(); + cmm_annotate_group_mb_release(&release_group); /* * Wait for readers to observe original parity or be quiescent. * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(®istry, &cur_snap_readers, &qsreaders); + wait_for_readers(®istry, &cur_snap_readers, &qsreaders, &acquire_group); /* * Must finish waiting for quiescent state for original parity before @@ -462,7 +407,8 @@ void synchronize_rcu(void) cmm_smp_mb(); /* Switch parity: 0 -> 1, 1 -> 0 */ - CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr ^ URCU_GP_CTR_PHASE); + cmm_annotate_group_mem_release(&release_group, &rcu_gp.ctr); + uatomic_store(&rcu_gp.ctr, rcu_gp.ctr ^ URCU_GP_CTR_PHASE, CMM_RELAXED); /* * Must commit rcu_gp.ctr update to memory before waiting for quiescent @@ -485,7 +431,7 @@ void synchronize_rcu(void) * wait_for_readers() can release and grab again rcu_registry_lock * internally. */ - wait_for_readers(&cur_snap_readers, NULL, &qsreaders); + wait_for_readers(&cur_snap_readers, NULL, &qsreaders, &acquire_group); /* * Put quiescent reader list back into registry. @@ -498,6 +444,7 @@ void synchronize_rcu(void) * iterates on reader threads. */ smp_mb_master(); + cmm_annotate_group_mb_acquire(&acquire_group); out: mutex_unlock(&rcu_registry_lock); mutex_unlock(&rcu_gp_lock); @@ -600,61 +547,13 @@ void rcu_init(void) } #endif -#ifdef RCU_SIGNAL -static void sigrcu_handler(int signo __attribute__((unused)), - siginfo_t *siginfo __attribute__((unused)), - void *context __attribute__((unused))) -{ - /* - * Executing this cmm_smp_mb() is the only purpose of this signal handler. - * It punctually promotes cmm_barrier() into cmm_smp_mb() on every thread it is - * executed on. - */ - cmm_smp_mb(); - _CMM_STORE_SHARED(URCU_TLS(rcu_reader).need_mb, 0); - cmm_smp_mb(); -} - -/* - * rcu_init constructor. Called when the library is linked, but also when - * reader threads are calling rcu_register_thread(). - * Should only be called by a single thread at a given time. This is ensured by - * holing the rcu_registry_lock from rcu_register_thread() or by running - * at library load time, which should not be executed by multiple - * threads nor concurrently with rcu_register_thread() anyway. - */ -void rcu_init(void) -{ - struct sigaction act; - int ret; - - if (init_done) - return; - init_done = 1; - - act.sa_sigaction = sigrcu_handler; - act.sa_flags = SA_SIGINFO | SA_RESTART; - sigemptyset(&act.sa_mask); - ret = sigaction(SIGRCU, &act, NULL); - if (ret) - urcu_die(errno); -} - void rcu_exit(void) { - /* - * Don't unregister the SIGRCU signal handler anymore, because - * call_rcu threads could still be using it shortly before the - * application exits. - * Assertion disabled because call_rcu threads are now rcu - * readers, and left running at exit. - * urcu_posix_assert(cds_list_empty(®istry)); - */ + urcu_call_rcu_exit(); } -#endif /* #ifdef RCU_SIGNAL */ - DEFINE_RCU_FLAVOR(rcu_flavor); #include "urcu-call-rcu-impl.h" #include "urcu-defer-impl.h" +#include "urcu-poll-impl.h" diff --git a/src/wfcqueue.c b/src/wfcqueue.c index 85de8ec..ff05510 100644 --- a/src/wfcqueue.c +++ b/src/wfcqueue.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2011-2012 Lai Jiangshan +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * wfcqueue.c - * * Userspace RCU library - Concurrent Queue with Wait-Free Enqueue/Blocking Dequeue - * - * Copyright 2010-2012 - Mathieu Desnoyers - * Copyright 2011-2012 - Lai Jiangshan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ diff --git a/src/wfqueue.c b/src/wfqueue.c index 509f4f9..062f801 100644 --- a/src/wfqueue.c +++ b/src/wfqueue.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * wfqueue.c - * * Userspace RCU library - Queue with Wait-Free Enqueue/Blocking Dequeue - * - * Copyright 2010 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Remove deprecation warnings from LGPL wrapper build. */ diff --git a/src/wfstack.c b/src/wfstack.c index 46300f9..8fddaec 100644 --- a/src/wfstack.c +++ b/src/wfstack.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * wfstack.c - * * Userspace RCU library - Stack with wait-free push, blocking traversal. - * - * Copyright 2010-2012 - Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ diff --git a/src/workqueue.c b/src/workqueue.c index e5931b5..10b9fde 100644 --- a/src/workqueue.c +++ b/src/workqueue.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010 Paul E. McKenney +// SPDX-FileCopyrightText: 2017 Mathieu Desnoyers +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * workqueue.c - * * Userspace RCU library - Userspace workqeues - * - * Copyright (c) 2010 Paul E. McKenney - * Copyright (c) 2017 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _LGPL_SOURCE @@ -131,16 +117,25 @@ static void futex_wait(int32_t *futex) { /* Read condition before read futex */ cmm_smp_mb(); - if (uatomic_read(futex) != -1) - return; - while (futex_async(futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + while (uatomic_read(futex) == -1) { + if (!futex_async(futex, FUTEX_WAIT, -1, NULL, NULL, 0)) { + /* + * Prior queued wakeups queued by unrelated code + * using the same address can cause futex wait to + * return 0 even through the futex value is still + * -1 (spurious wakeups). Check the value again + * in user-space to validate whether it really + * differs from -1. + */ + continue; + } switch (errno) { - case EWOULDBLOCK: + case EAGAIN: /* Value already changed. */ return; case EINTR: /* Retry if interrupted by signal. */ - break; /* Get out of switch. */ + break; /* Get out of switch. Check again. */ default: /* Unexpected error. */ urcu_die(errno); @@ -275,6 +270,7 @@ struct urcu_workqueue *urcu_workqueue_create(unsigned long flags, { struct urcu_workqueue *workqueue; int ret; + sigset_t newmask, oldmask; workqueue = malloc(sizeof(*workqueue)); if (workqueue == NULL) @@ -295,10 +291,20 @@ struct urcu_workqueue *urcu_workqueue_create(unsigned long flags, workqueue->cpu_affinity = cpu_affinity; workqueue->loop_count = 0; cmm_smp_mb(); /* Structure initialized before pointer is planted. */ + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); + ret = pthread_create(&workqueue->tid, NULL, workqueue_thread, workqueue); if (ret) { urcu_die(ret); } + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); + urcu_posix_assert(!ret); + return workqueue; } @@ -378,7 +384,7 @@ struct urcu_workqueue_completion *urcu_workqueue_create_completion(void) { struct urcu_workqueue_completion *completion; - completion = calloc(sizeof(*completion), 1); + completion = calloc(1, sizeof(*completion)); if (!completion) urcu_die(errno); urcu_ref_set(&completion->ref, 1); @@ -409,7 +415,7 @@ void urcu_workqueue_queue_completion(struct urcu_workqueue *workqueue, { struct urcu_workqueue_completion_work *work; - work = calloc(sizeof(*work), 1); + work = calloc(1, sizeof(*work)); if (!work) urcu_die(errno); work->completion = completion; @@ -455,13 +461,23 @@ void urcu_workqueue_resume_worker(struct urcu_workqueue *workqueue) void urcu_workqueue_create_worker(struct urcu_workqueue *workqueue) { int ret; + sigset_t newmask, oldmask; /* Clear workqueue state from parent. */ workqueue->flags &= ~URCU_WORKQUEUE_PAUSED; workqueue->flags &= ~URCU_WORKQUEUE_PAUSE; workqueue->tid = 0; + + ret = sigfillset(&newmask); + urcu_posix_assert(!ret); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); + urcu_posix_assert(!ret); + ret = pthread_create(&workqueue->tid, NULL, workqueue_thread, workqueue); if (ret) { urcu_die(ret); } + + ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); + urcu_posix_assert(!ret); } diff --git a/src/workqueue.h b/src/workqueue.h index 52b6973..ed391da 100644 --- a/src/workqueue.h +++ b/src/workqueue.h @@ -1,27 +1,13 @@ +// SPDX-FileCopyrightText: 2009,2017 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef _URCU_WORKQUEUE_H #define _URCU_WORKQUEUE_H /* - * workqueue.h - * * Userspace RCU header - Userspace workqueues - * - * Copyright (c) 2009,2017 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/tests/Makefile.am b/tests/Makefile.am index 8e0e6d1..c4f4afa 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + SUBDIRS = utils common unit benchmark regression .PHONY: short_bench long_bench regtest check-loop diff --git a/tests/benchmark/Makefile.am b/tests/benchmark/Makefile.am index 30c5291..e5ce2e9 100644 --- a/tests/benchmark/Makefile.am +++ b/tests/benchmark/Makefile.am @@ -1,14 +1,20 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/common +AM_CPPFLAGS += -include $(top_srcdir)/tests/benchmark/common-states.h TEST_EXTENSIONS = .tap TAP_LOG_DRIVER_FLAGS = --merge --comments -TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ - $(top_srcdir)/tests/utils/tap-driver.sh +TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \ + URCU_TESTS_SRCDIR='$(abs_top_srcdir)/tests' \ + URCU_TESTS_BUILDDIR='$(abs_top_builddir)/tests' \ + $(SHELL) $(top_srcdir)/tests/utils/tap-driver.sh -SCRIPT_LIST = common.sh \ - run-urcu-tests.sh \ - runhash.sh \ - runtests.sh \ +noinst_HEADERS = common-states.h + +SCRIPT_LIST = \ runpaul-phase1.sh \ runpaul-phase2.sh \ runpaul-phase3.sh \ @@ -16,10 +22,14 @@ SCRIPT_LIST = common.sh \ runpaul-phase5.sh \ runpaul-phase6.sh \ runpaul-phase7.sh \ - runtests-batch.sh \ subphase4.sh -dist_noinst_SCRIPTS = $(SCRIPT_LIST) +dist_noinst_SCRIPTS = \ + runhash.sh \ + runtests-batch.sh \ + runtests.sh \ + run-urcu-tests.sh \ + $(SCRIPT_LIST) dist_noinst_DATA = \ hashtable_1_seconds.tap \ @@ -30,13 +40,12 @@ dist_noinst_DATA = \ urcu_30_seconds.tap noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \ - test_urcu_signal test_urcu_signal_dynamic_link test_urcu_signal_timing \ test_rwlock_timing test_rwlock test_perthreadlock_timing \ - test_perthreadlock test_urcu_yield test_urcu_signal_yield test_urcu_mb \ + test_perthreadlock test_urcu_yield test_urcu_mb \ test_urcu_qsbr_timing test_urcu_qsbr \ - test_mutex test_looplen test_urcu_gc test_urcu_signal_gc \ + test_mutex test_looplen test_urcu_gc \ test_urcu_lgc \ - test_urcu_mb_gc test_urcu_qsbr_gc test_urcu_qsbr_lgc test_urcu_signal_lgc \ + test_urcu_mb_gc test_urcu_qsbr_gc test_urcu_qsbr_lgc \ test_urcu_mb_lgc test_urcu_qsbr_dynamic_link test_urcu_defer \ test_urcu_assign test_urcu_assign_dynamic_link \ test_urcu_bp test_urcu_bp_dynamic_link test_cycles_per_loop \ @@ -52,182 +61,156 @@ URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la URCU_LIB=$(top_builddir)/src/liburcu.la URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la DEBUG_YIELD_LIB=$(builddir)/../common/libdebug-yield.la -test_urcu_SOURCES = test_urcu.c +test_urcu_SOURCES = test_urcu.c common-states.c test_urcu_LDADD = $(URCU_LIB) -test_urcu_dynamic_link_SOURCES = test_urcu.c +test_urcu_dynamic_link_SOURCES = test_urcu.c common-states.c test_urcu_dynamic_link_LDADD = $(URCU_LIB) test_urcu_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_timing_SOURCES = test_urcu_timing.c +test_urcu_timing_SOURCES = test_urcu_timing.c common-states.c test_urcu_timing_LDADD = $(URCU_LIB) -test_urcu_yield_SOURCES = test_urcu.c +test_urcu_yield_SOURCES = test_urcu.c common-states.c test_urcu_yield_LDADD = $(URCU_LIB) $(DEBUG_YIELD_LIB) test_urcu_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS) -test_urcu_qsbr_SOURCES = test_urcu_qsbr.c +test_urcu_qsbr_SOURCES = test_urcu_qsbr.c common-states.c test_urcu_qsbr_LDADD = $(URCU_QSBR_LIB) -test_urcu_qsbr_timing_SOURCES = test_urcu_qsbr_timing.c +test_urcu_qsbr_timing_SOURCES = test_urcu_qsbr_timing.c common-states.c test_urcu_qsbr_timing_LDADD = $(URCU_QSBR_LIB) -test_urcu_mb_SOURCES = test_urcu.c +test_urcu_mb_SOURCES = test_urcu.c common-states.c test_urcu_mb_LDADD = $(URCU_MB_LIB) test_urcu_mb_CFLAGS = -DRCU_MB $(AM_CFLAGS) -test_urcu_signal_SOURCES = test_urcu.c -test_urcu_signal_LDADD = $(URCU_SIGNAL_LIB) -test_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) - -test_urcu_signal_dynamic_link_SOURCES = test_urcu.c -test_urcu_signal_dynamic_link_LDADD = $(URCU_SIGNAL_LIB) -test_urcu_signal_dynamic_link_CFLAGS = -DRCU_SIGNAL -DDYNAMIC_LINK_TEST \ - $(AM_CFLAGS) - -test_urcu_signal_timing_SOURCES = test_urcu_timing.c -test_urcu_signal_timing_LDADD = $(URCU_SIGNAL_LIB) -test_urcu_signal_timing_CFLAGS= -DRCU_SIGNAL $(AM_CFLAGS) +test_rwlock_timing_SOURCES = test_rwlock_timing.c common-states.c +test_rwlock_timing_LDADD = $(URCU_LIB) -test_urcu_signal_yield_SOURCES = test_urcu.c -test_urcu_signal_yield_LDADD = $(URCU_SIGNAL_LIB) $(DEBUG_YIELD_LIB) -test_urcu_signal_yield_CFLAGS = -DRCU_SIGNAL -DDEBUG_YIELD $(AM_CFLAGS) +test_rwlock_SOURCES = test_rwlock.c common-states.c +test_rwlock_LDADD = $(URCU_LIB) -test_rwlock_timing_SOURCES = test_rwlock_timing.c -test_rwlock_timing_LDADD = $(URCU_SIGNAL_LIB) +test_perthreadlock_timing_SOURCES = test_perthreadlock_timing.c common-states.c +test_perthreadlock_timing_LDADD = $(URCU_LIB) -test_rwlock_SOURCES = test_rwlock.c -test_rwlock_LDADD = $(URCU_SIGNAL_LIB) +test_perthreadlock_SOURCES = test_perthreadlock.c common-states.c +test_perthreadlock_LDADD = $(URCU_LIB) -test_perthreadlock_timing_SOURCES = test_perthreadlock_timing.c -test_perthreadlock_timing_LDADD = $(URCU_SIGNAL_LIB) +test_mutex_SOURCES = test_mutex.c common-states.c -test_perthreadlock_SOURCES = test_perthreadlock.c -test_perthreadlock_LDADD = $(URCU_SIGNAL_LIB) +test_looplen_SOURCES = test_looplen.c common-states.c -test_mutex_SOURCES = test_mutex.c - -test_looplen_SOURCES = test_looplen.c - -test_urcu_gc_SOURCES = test_urcu_gc.c +test_urcu_gc_SOURCES = test_urcu_gc.c common-states.c test_urcu_gc_LDADD = $(URCU_LIB) -test_urcu_signal_gc_SOURCES = test_urcu_gc.c -test_urcu_signal_gc_LDADD = $(URCU_SIGNAL_LIB) -test_urcu_signal_gc_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) - -test_urcu_mb_gc_SOURCES = test_urcu_gc.c +test_urcu_mb_gc_SOURCES = test_urcu_gc.c common-states.c test_urcu_mb_gc_LDADD = $(URCU_MB_LIB) test_urcu_mb_gc_CFLAGS = -DRCU_MB $(AM_CFLAGS) -test_urcu_qsbr_gc_SOURCES = test_urcu_qsbr_gc.c +test_urcu_qsbr_gc_SOURCES = test_urcu_qsbr_gc.c common-states.c test_urcu_qsbr_gc_LDADD = $(URCU_QSBR_LIB) -test_urcu_qsbr_lgc_SOURCES = test_urcu_qsbr_gc.c +test_urcu_qsbr_lgc_SOURCES = test_urcu_qsbr_gc.c common-states.c test_urcu_qsbr_lgc_LDADD = $(URCU_QSBR_LIB) test_urcu_qsbr_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) -test_urcu_lgc_SOURCES = test_urcu_gc.c +test_urcu_lgc_SOURCES = test_urcu_gc.c common-states.c test_urcu_lgc_LDADD = $(URCU_LIB) test_urcu_lgc_CFLAGS = -DTEST_LOCAL_GC $(AM_CFLAGS) -test_urcu_signal_lgc_SOURCES = test_urcu_gc.c -test_urcu_signal_lgc_LDADD = $(URCU_SIGNAL_LIB) -test_urcu_signal_lgc_CFLAGS = -DRCU_SIGNAL -DTEST_LOCAL_GC $(AM_CFLAGS) - -test_urcu_mb_lgc_SOURCES = test_urcu_gc.c +test_urcu_mb_lgc_SOURCES = test_urcu_gc.c common-states.c test_urcu_mb_lgc_LDADD = $(URCU_MB_LIB) test_urcu_mb_lgc_CFLAGS = -DTEST_LOCAL_GC -DRCU_MB $(AM_CFLAGS) -test_urcu_qsbr_dynamic_link_SOURCES = test_urcu_qsbr.c +test_urcu_qsbr_dynamic_link_SOURCES = test_urcu_qsbr.c common-states.c test_urcu_qsbr_dynamic_link_LDADD = $(URCU_QSBR_LIB) test_urcu_qsbr_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_defer_SOURCES = test_urcu_defer.c +test_urcu_defer_SOURCES = test_urcu_defer.c common-states.c test_urcu_defer_LDADD = $(URCU_LIB) test_cycles_per_loop_SOURCES = test_cycles_per_loop.c -test_urcu_assign_SOURCES = test_urcu_assign.c +test_urcu_assign_SOURCES = test_urcu_assign.c common-states.c test_urcu_assign_LDADD = $(URCU_LIB) -test_urcu_assign_dynamic_link_SOURCES = test_urcu_assign.c +test_urcu_assign_dynamic_link_SOURCES = test_urcu_assign.c common-states.c test_urcu_assign_dynamic_link_LDADD = $(URCU_LIB) test_urcu_assign_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_bp_SOURCES = test_urcu_bp.c +test_urcu_bp_SOURCES = test_urcu_bp.c common-states.c test_urcu_bp_LDADD = $(URCU_BP_LIB) -test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c +test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c common-states.c test_urcu_bp_dynamic_link_LDADD = $(URCU_BP_LIB) test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_urcu_lfq_SOURCES = test_urcu_lfq.c +test_urcu_lfq_SOURCES = test_urcu_lfq.c common-states.c test_urcu_lfq_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c +test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c common-states.c test_urcu_lfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_lfq_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_wfq_SOURCES = test_urcu_wfq.c +test_urcu_wfq_SOURCES = test_urcu_wfq.c common-states.c test_urcu_wfq_LDADD = $(URCU_COMMON_LIB) -test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c +test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c common-states.c test_urcu_wfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_wfq_dynlink_LDADD = $(URCU_COMMON_LIB) -test_urcu_wfcq_SOURCES = test_urcu_wfcq.c +test_urcu_wfcq_SOURCES = test_urcu_wfcq.c common-states.c test_urcu_wfcq_LDADD = $(URCU_COMMON_LIB) -test_urcu_wfcq_dynlink_SOURCES = test_urcu_wfcq.c +test_urcu_wfcq_dynlink_SOURCES = test_urcu_wfcq.c common-states.c test_urcu_wfcq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_wfcq_dynlink_LDADD = $(URCU_COMMON_LIB) -test_urcu_lfs_SOURCES = test_urcu_lfs.c +test_urcu_lfs_SOURCES = test_urcu_lfs.c common-states.c test_urcu_lfs_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_lfs_rcu_SOURCES = test_urcu_lfs_rcu.c +test_urcu_lfs_rcu_SOURCES = test_urcu_lfs_rcu.c common-states.c test_urcu_lfs_rcu_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c +test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c common-states.c test_urcu_lfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_lfs_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_lfs_rcu_dynlink_SOURCES = test_urcu_lfs_rcu.c +test_urcu_lfs_rcu_dynlink_SOURCES = test_urcu_lfs_rcu.c common-states.c test_urcu_lfs_rcu_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_lfs_rcu_dynlink_LDADD = $(URCU_LIB) $(URCU_CDS_LIB) -test_urcu_wfs_SOURCES = test_urcu_wfs.c +test_urcu_wfs_SOURCES = test_urcu_wfs.c common-states.c test_urcu_wfs_LDADD = $(URCU_COMMON_LIB) -test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c +test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c common-states.c 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 test_urcu_hash.h \ - test_urcu_hash_rw.c test_urcu_hash_unique.c + test_urcu_hash_rw.c test_urcu_hash_unique.c common-states.c test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS) test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_COMMON_LIB) $(URCU_CDS_LIB) all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST) $(TEST_LIST); do \ + for script in $(SCRIPT_LIST); do \ cp -f $(srcdir)/$$script $(builddir); \ done; \ fi clean-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST) $(TEST_LIST); do \ + for script in $(SCRIPT_LIST); do \ rm -f $(builddir)/$$script; \ done; \ fi diff --git a/tests/benchmark/common-states.c b/tests/benchmark/common-states.c new file mode 100644 index 0000000..4a7f719 --- /dev/null +++ b/tests/benchmark/common-states.c @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +volatile int _test_go = 0, _test_stop = 0; diff --git a/tests/benchmark/common-states.h b/tests/benchmark/common-states.h new file mode 100644 index 0000000..d46fd38 --- /dev/null +++ b/tests/benchmark/common-states.h @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +/* Common states for benchmarks. */ + +#include + +#include + +extern volatile int _test_go, _test_stop; + +static inline void complete_sleep(unsigned int seconds) +{ + while (seconds != 0) { + seconds = sleep(seconds); + } +} + +static inline void begin_test(void) +{ + uatomic_store(&_test_go, 1, CMM_RELEASE); +} + +static inline void end_test(void) +{ + uatomic_store(&_test_stop, 1, CMM_RELAXED); +} + +static inline void test_for(unsigned int duration) +{ + begin_test(); + complete_sleep(duration); + end_test(); +} + +static inline void wait_until_go(void) +{ + while (!uatomic_load(&_test_go, CMM_ACQUIRE)) + { + } +} + +/* + * returns 0 if test should end. + */ +static inline int test_duration_write(void) +{ + return !uatomic_load(&_test_stop, CMM_RELAXED); +} + +static inline int test_duration_read(void) +{ + return !uatomic_load(&_test_stop, CMM_RELAXED); +} diff --git a/tests/benchmark/common.sh b/tests/benchmark/common.sh deleted file mode 100755 index 4dbc567..0000000 --- a/tests/benchmark/common.sh +++ /dev/null @@ -1,36 +0,0 @@ -# -# This file is meant to be sourced from other tests scripts. -# - -cleanup() { - if [ x"$TMPFILE" != "x" ]; then - rm -f "$TMPFILE" - fi - - # Call the tap.sh exit cleanup code - _exit -} - -xseq() { - i=$1 - while [[ "$i" -le "$2" ]]; do - echo "$i" - i=$(( i + 1 )) - done -} - -# Set TEST_TIME_BIN -if [ -x "$URCU_TEST_TIME_BIN" ]; then - TEST_TIME_BIN="$URCU_TEST_TIME_BIN" -elif [ -x "/usr/bin/time" ]; then - TEST_TIME_BIN="/usr/bin/time" -else - TEST_TIME_BIN="" -fi -export TEST_TIME_BIN - -# Create a temporary file for tests output -TMPFILE=$(mktemp) - -# Set traps to delete the temporary file on exit -trap cleanup EXIT diff --git a/tests/benchmark/hashtable_1_seconds.tap b/tests/benchmark/hashtable_1_seconds.tap index 48c4adb..d71cc3f 100755 --- a/tests/benchmark/hashtable_1_seconds.tap +++ b/tests/benchmark/hashtable_1_seconds.tap @@ -1 +1,18 @@ -./runhash.sh 1 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/runhash.sh" 1 diff --git a/tests/benchmark/hashtable_30_seconds.tap b/tests/benchmark/hashtable_30_seconds.tap index 0c40ef8..49ad0e6 100755 --- a/tests/benchmark/hashtable_30_seconds.tap +++ b/tests/benchmark/hashtable_30_seconds.tap @@ -1 +1,18 @@ -./runhash.sh 30 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/runhash.sh" 30 diff --git a/tests/benchmark/hashtable_3_seconds.tap b/tests/benchmark/hashtable_3_seconds.tap index 031aa77..c63618b 100755 --- a/tests/benchmark/hashtable_3_seconds.tap +++ b/tests/benchmark/hashtable_3_seconds.tap @@ -1 +1,18 @@ -./runhash.sh 3 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/runhash.sh" 3 diff --git a/tests/benchmark/run-urcu-tests.sh b/tests/benchmark/run-urcu-tests.sh index 751514a..13347ee 100755 --- a/tests/benchmark/run-urcu-tests.sh +++ b/tests/benchmark/run-urcu-tests.sh @@ -1,6 +1,24 @@ -#!/bin/bash +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# Enable TAP +SH_TAP=1 + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" -#first parameter: seconds per test + +# First parameter: seconds per test DURATION=$1 if [ "x${DURATION}" = "x" ]; then @@ -8,29 +26,23 @@ if [ "x${DURATION}" = "x" ]; then exit 1 fi -. ../utils/tap.sh -. ./common.sh - -NUM_CPUS="1" -for i in nproc gnproc; do - NUM_CPUS=$($i 2>/dev/null) - if [ "$?" -eq "0" ]; then - break - else - NUM_CPUS="1" - fi -done +# Create a temporary file for tests output +TMPFILE=$(mktemp) + +# Set trap to delete the temporary file on exit and call tap.sh '_exit' +trap 'rm -f "$TMPFILE"; _exit' EXIT -#set to number of active CPUS +# Set to number of active CPUS +NUM_CPUS="$(urcu_nproc)" if [[ ${NUM_CPUS} -lt 4 ]]; then NUM_CPUS=4 # Floor at 4 due to following assumptions. fi # batch: 19 * 1 = 19 -# fraction: 15 * 29 = -# scalabilit NUM_CPUS * 15 -# reader 15 * 23 = -NUM_TESTS=$(( 19 + 435 + ( NUM_CPUS * 15 ) + 345 )) +# fraction: 12 * 29 = +# scalabilit NUM_CPUS * 12 +# reader 12 * 23 = +NUM_TESTS=$(( 19 + 348 + ( NUM_CPUS * 12 ) + 276 )) plan_tests ${NUM_TESTS} @@ -56,6 +68,7 @@ diag "Executing URCU tests" #x: vary update fraction from 0 to 0.0001 #fix number of readers and reader C.S. length, vary delay between updates #y: ops/s +EXTRA_OPTS="" diag "Executing batch RCU test" @@ -69,17 +82,17 @@ NR_READERS=$((NUM_CPUS - NR_WRITERS)) for BATCH_SIZE in ${BATCH_ARRAY}; do for TEST in ${BATCH_TEST_ARRAY}; do - okx ${TEST_TIME_BIN} ./"${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ + okx ${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ -d 0 -b "${BATCH_SIZE}" ${EXTRA_OPTS} 2>"${TMPFILE}" - while read line; do + while read -r line; do echo "## $line" done <"${TMPFILE}" done done -TEST_ARRAY="test_urcu_gc test_urcu_signal_gc test_urcu_mb_gc test_urcu_qsbr_gc - test_urcu_lgc test_urcu_signal_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc - test_urcu test_urcu_signal test_urcu_mb test_urcu_qsbr +TEST_ARRAY="test_urcu_gc test_urcu_mb_gc test_urcu_qsbr_gc + test_urcu_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc + test_urcu test_urcu_mb test_urcu_qsbr test_rwlock test_perthreadlock test_mutex" #setting gc each 32768. ** UPDATE FOR YOUR ARCHITECTURE BASED ON TEST ABOVE ** @@ -95,9 +108,9 @@ NR_READERS=$((NUM_CPUS - NR_WRITERS)) for WDELAY in ${WDELAY_ARRAY}; do for TEST in ${TEST_ARRAY}; do - okx ${TEST_TIME_BIN} ./"${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ + okx ${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ -d "${WDELAY}" ${EXTRA_OPTS} 2>"${TMPFILE}" - while read line; do + while read -r line; do echo "## $line" done <"${TMPFILE}" done @@ -112,11 +125,11 @@ diag "Executing scalability test" NR_WRITERS=0 -for NR_READERS in $(xseq 1 ${NUM_CPUS}); do +for NR_READERS in $(urcu_xseq 1 ${NUM_CPUS}); do for TEST in ${TEST_ARRAY}; do - okx ${TEST_TIME_BIN} ./"${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ + okx ${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ ${EXTRA_OPTS} 2>"${TMPFILE}" - while read line; do + while read -r line; do echo "## $line" done <"${TMPFILE}" done @@ -137,9 +150,9 @@ READERCSLEN_ARRAY="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 3276 for READERCSLEN in ${READERCSLEN_ARRAY}; do for TEST in ${TEST_ARRAY}; do - okx ${TEST_TIME_BIN} ./"${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ + okx ${URCU_TESTS_TIME_BIN} "${URCU_TESTS_BUILDDIR}/benchmark/${TEST}" "${NR_READERS}" "${NR_WRITERS}" "${DURATION}" \ -c "${READERCSLEN}" ${EXTRA_OPTS} 2>"${TMPFILE}" - while read line; do + while read -r line; do echo "## $line" done <"${TMPFILE}" done diff --git a/tests/benchmark/runhash.sh b/tests/benchmark/runhash.sh index 4f693d1..c3f42eb 100755 --- a/tests/benchmark/runhash.sh +++ b/tests/benchmark/runhash.sh @@ -1,4 +1,22 @@ -#!/bin/bash +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# Enable TAP +SH_TAP=1 + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + # 1st parameter: seconds per test DURATION=$1 @@ -8,8 +26,6 @@ if [ "x${DURATION}" = "x" ]; then exit 1 fi -source ../utils/tap.sh - NUM_TESTS=17 plan_tests ${NUM_TESTS} @@ -21,19 +37,10 @@ diag "Executing Hash table test" # add/remove/random # - validate that "nr_leaked" is always 0 in SUMMARY for all tests -TESTPROG=./test_urcu_hash - -NUM_CPUS="1" -for i in nproc gnproc; do - NUM_CPUS=$($i 2>/dev/null) - if [ "$?" -eq "0" ]; then - break - else - NUM_CPUS="1" - fi -done +TESTPROG="${URCU_TESTS_BUILDDIR}/benchmark/test_urcu_hash" #thread multiplier: number of processors divided by 4. +NUM_CPUS="$(urcu_nproc)" if [[ ${NUM_CPUS} -lt 4 ]]; then NUM_CPUS=4 # Floor at 4 due to following assumptions. fi @@ -46,19 +53,19 @@ EXTRA_PARAMS=-v # rw test, single key, replace and del randomly, 4 threads, auto resize. # key range: init, lookup, and update: 0 to 0 -okx ${TESTPROG} 0 $((4*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS} +okx "${TESTPROG}" 0 $((4*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS} # rw test, single key, add unique and del randomly, 4 threads, auto resize. # key range: init, lookup, and update: 0 to 0 -okx ${TESTPROG} 0 $((4*THREAD_MUL)) "${DURATION}" -A -u -M 1 -N 1 -O 1 ${EXTRA_PARAMS} +okx "${TESTPROG}" 0 $((4*THREAD_MUL)) "${DURATION}" -A -u -M 1 -N 1 -O 1 ${EXTRA_PARAMS} # rw test, single key, replace and del randomly, 2 lookup threads, 2 update threads, auto resize. # key range: init, lookup, and update: 0 to 0 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS} +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS} # rw test, single key, add and del randomly, 2 lookup threads, 2 update threads, auto resize. # key range: init, lookup, and update: 0 to 0 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -M 1 -N 1 -O 1 ${EXTRA_PARAMS} +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -M 1 -N 1 -O 1 ${EXTRA_PARAMS} # ** test updates vs lookups with default table @@ -66,17 +73,17 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -M 1 -N 1 - # rw test, 2 lookup, 2 update threads, add and del randomly, auto resize. # max 1048576 buckets # key range: init, lookup, and update: 0 to 999999 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A ${EXTRA_PARAMS} +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add_replace and del randomly, auto resize. # max 1048576 buckets # key range: init, lookup, and update: 0 to 999999 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s ${EXTRA_PARAMS} +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add_unique and del randomly, auto resize. # max 1048576 buckets # key range: init, lookup, and update: 0 to 999999 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -u ${EXTRA_PARAMS} +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -u ${EXTRA_PARAMS} # test memory management backends @@ -85,21 +92,21 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -u ${EXTRA_ # max buckets: 1048576 # key range: init, lookup, and update: 0 to 99999999 # mm backend: "order" -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ -M 100000000 -N 100000000 -O 100000000 -B order ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add only, auto resize. # max buckets: 1048576 # key range: init, lookup, and update: 0 to 99999999 # mm backend: "chunk" -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ -M 100000000 -N 100000000 -O 100000000 -B chunk ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add only, auto resize. # max buckets: 1048576 # key range: init, lookup, and update: 0 to 99999999 # mm backend: "mmap" -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 1048576 -i \ -M 100000000 -N 100000000 -O 100000000 -B mmap ${EXTRA_PARAMS} @@ -111,7 +118,7 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -m 1 -n 104 # key range: lookup: 1000000 to 1999999 # NOTE: reader threads in this test should never have a successful # lookup. TODO -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -R 1000000 ${EXTRA_PARAMS} # ** small key range @@ -119,19 +126,19 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ # rw test, 2 lookup, 2 update threads, add and del randomly, auto resize. # max 1048576 buckets # key range: init, update, and lookups: 0 to 9 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -M 10 -N 10 -O 10 ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add_unique and del randomly, auto resize. # max 1048576 buckets # key range: init, update, and lookups: 0 to 9 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -M 10 -N 10 -O 10 -u ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add_replace and del randomly, auto resize. # max 1048576 buckets # key range: init, update, and lookups: 0 to 9 -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -M 10 -N 10 -O 10 -s ${EXTRA_PARAMS} # ** lookup for known keys @@ -143,7 +150,7 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ # key range: updates: 10 to 19 # NOTE: reader threads in this test should always have successful # lookups. TODO -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -M 10 -N 10 -O 10 -R 0 -T 0 -S 10 -k 10 -s ${EXTRA_PARAMS} # ** Uniqueness test @@ -152,12 +159,12 @@ okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ # max 1048576 buckets # asserts that no duplicates are observed by reader threads # standard length hash chains -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -U ${EXTRA_PARAMS} # rw test, 2 lookup, 2 update threads, add_unique, add_replace and del randomly, auto resize. # max 1048576 buckets # asserts that no duplicates are observed by reader threads # create long hash chains: using modulo 4 on keys as hash -okx ${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ +okx "${TESTPROG}" $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A \ -U -C 4 ${EXTRA_PARAMS} diff --git a/tests/benchmark/runpaul-phase1.sh b/tests/benchmark/runpaul-phase1.sh index d2c8649..4ebea56 100755 --- a/tests/benchmark/runpaul-phase1.sh +++ b/tests/benchmark/runpaul-phase1.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/runpaul-phase2.sh b/tests/benchmark/runpaul-phase2.sh index bba9e3e..74fbd5b 100755 --- a/tests/benchmark/runpaul-phase2.sh +++ b/tests/benchmark/runpaul-phase2.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/runpaul-phase3.sh b/tests/benchmark/runpaul-phase3.sh index 7c5f055..4618c3c 100755 --- a/tests/benchmark/runpaul-phase3.sh +++ b/tests/benchmark/runpaul-phase3.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/runpaul-phase4.sh b/tests/benchmark/runpaul-phase4.sh index ede402c..4edddc4 100755 --- a/tests/benchmark/runpaul-phase4.sh +++ b/tests/benchmark/runpaul-phase4.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/runpaul-phase5.sh b/tests/benchmark/runpaul-phase5.sh index bb4bfe7..5d462ec 100755 --- a/tests/benchmark/runpaul-phase5.sh +++ b/tests/benchmark/runpaul-phase5.sh @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + # test run after write-size update sh runpaul-phase1.sh diff --git a/tests/benchmark/runpaul-phase6.sh b/tests/benchmark/runpaul-phase6.sh index 5f65072..647749b 100755 --- a/tests/benchmark/runpaul-phase6.sh +++ b/tests/benchmark/runpaul-phase6.sh @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + sh runpaul-phase1.sh mkdir runpaul-phase1 mv *.log runpaul-phase1/ diff --git a/tests/benchmark/runpaul-phase7.sh b/tests/benchmark/runpaul-phase7.sh index 4c301da..83afd50 100755 --- a/tests/benchmark/runpaul-phase7.sh +++ b/tests/benchmark/runpaul-phase7.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/runtests-batch.sh b/tests/benchmark/runtests-batch.sh index f030de6..93af6d4 100755 --- a/tests/benchmark/runtests-batch.sh +++ b/tests/benchmark/runtests-batch.sh @@ -1,7 +1,29 @@ -#!/bin/bash +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# Enable TAP +SH_TAP=1 + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +# Create a temporary file for tests output +TMPFILE=$(mktemp) + +# Set trap to delete the temporary file on exit and call tap.sh '_exit' +trap 'rm -f "$TMPFILE"; _exit' EXIT -. ../utils/tap.sh -. ./common.sh NUM_TESTS=1 @@ -9,6 +31,6 @@ plan_tests ${NUM_TESTS} #for a in test_urcu_gc test_urcu_gc_mb test_urcu_qsbr_gc; do for a in test_urcu_gc; do - okx "${TEST_TIME_BIN}" ./"${a}" "$@" 2>"${TMPFILE}" + okx "${URCU_TESTS_TIME_BIN}" "${URCU_TESTS_BUILDDIR}/benchmark/${a}" "$@" 2>"${TMPFILE}" diag "time: $(cat "${TMPFILE}")" done diff --git a/tests/benchmark/runtests.sh b/tests/benchmark/runtests.sh index dd5d662..761a547 100755 --- a/tests/benchmark/runtests.sh +++ b/tests/benchmark/runtests.sh @@ -1,16 +1,38 @@ -#!/bin/bash +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# -. ../utils/tap.sh -. ./common.sh +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi -NUM_TESTS=15 +# Enable TAP +SH_TAP=1 + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +# Create a temporary file for tests output +TMPFILE=$(mktemp) + +# Set trap to delete the temporary file on exit and call tap.sh '_exit' +trap 'rm -f "$TMPFILE"; _exit' EXIT + + +NUM_TESTS=12 plan_tests ${NUM_TESTS} -for a in test_urcu_gc test_urcu_signal_gc test_urcu_mb_gc test_urcu_qsbr_gc \ - test_urcu_lgc test_urcu_signal_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc \ - test_urcu test_urcu_signal test_urcu_mb test_urcu_qsbr \ +for a in test_urcu_gc test_urcu_mb_gc test_urcu_qsbr_gc \ + test_urcu_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc \ + test_urcu test_urcu_mb test_urcu_qsbr \ test_rwlock test_perthreadlock test_mutex; do - okx ${TEST_TIME_BIN} ./"${a}" "$@" 2>"${TMPFILE}" + okx ${URCU_TESTS_TIME_BIN} "$URCU_TESTS_BUILDDIR/benchmark/${a}" "$@" 2>"${TMPFILE}" diag "time: $(cat "${TMPFILE}")" done diff --git a/tests/benchmark/subphase4.sh b/tests/benchmark/subphase4.sh index d0d7587..95f39e1 100755 --- a/tests/benchmark/subphase4.sh +++ b/tests/benchmark/subphase4.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +# +# SPDX-License-Identifier: GPL-2.0-only + #run all tests #set to number of active CPUS diff --git a/tests/benchmark/test_cycles_per_loop.c b/tests/benchmark/test_cycles_per_loop.c index ca66ffa..7fec92c 100644 --- a/tests/benchmark/test_cycles_per_loop.c +++ b/tests/benchmark/test_cycles_per_loop.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_cycles_per_loop.c - * * Userspace RCU library - test cycles per loop - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_looplen.c b/tests/benchmark/test_looplen.c index d969ffc..b743828 100644 --- a/tests/benchmark/test_looplen.c +++ b/tests/benchmark/test_looplen.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_looplen.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_mutex.c b/tests/benchmark/test_mutex.c index 55f7c38..6254e15 100644 --- a/tests/benchmark/test_mutex.c +++ b/tests/benchmark/test_mutex.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -49,8 +35,6 @@ struct test_array { static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -static volatile int test_go, test_stop; - static unsigned long wdelay; static volatile struct test_array test_array = { 8 }; @@ -111,19 +95,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -147,9 +118,7 @@ void *thr_reader(void *data) set_affinity(); - while (!test_go) - { - } + wait_until_go(); for (;;) { int v; @@ -182,10 +151,7 @@ void *thr_writer(void *data) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { pthread_mutex_lock(&lock); @@ -325,13 +291,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index 47a512c..2cc50d1 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -53,8 +39,6 @@ struct per_thread_lock { static struct per_thread_lock *per_thread_lock; -static volatile int test_go, test_stop; - static unsigned long wdelay; static volatile struct test_array test_array = { 8 }; @@ -117,19 +101,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -175,9 +146,7 @@ void *thr_reader(void *data) set_affinity(); - while (!test_go) - { - } + wait_until_go(); for (;;) { int v; @@ -211,10 +180,7 @@ void *thr_writer(void *data) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { for (tidx = 0; tidx < (long)nr_readers; tidx++) { @@ -359,13 +325,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_perthreadlock_timing.c b/tests/benchmark/test_perthreadlock_timing.c index 34aae5f..7822275 100644 --- a/tests/benchmark/test_perthreadlock_timing.c +++ b/tests/benchmark/test_perthreadlock_timing.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_perthreadloc_timing.c - * * Per thread locks - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c index 6908ea4..b275f78 100644 --- a/tests/benchmark/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -53,8 +39,6 @@ struct test_array { */ pthread_rwlock_t lock; -static volatile int test_go, test_stop; - static unsigned long wdelay; static volatile struct test_array test_array = { 8 }; @@ -116,19 +100,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -147,9 +118,7 @@ void *thr_reader(void *_count) set_affinity(); - while (!test_go) - { - } + wait_until_go(); for (;;) { int a, ret; @@ -194,10 +163,7 @@ void *thr_writer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { int ret; @@ -355,13 +321,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_rwlock_timing.c b/tests/benchmark/test_rwlock_timing.c index 99c957c..2bae56c 100644 --- a/tests/benchmark/test_rwlock_timing.c +++ b/tests/benchmark/test_rwlock_timing.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_urcu.c b/tests/benchmark/test_urcu.c index ea849fa..053993a 100644 --- a/tests/benchmark/test_urcu.c +++ b/tests/benchmark/test_urcu.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -44,8 +30,6 @@ #endif #include -static volatile int test_go, test_stop; - static unsigned long wdelay; static int *test_rcu_pointer; @@ -107,19 +91,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -142,10 +113,7 @@ void *thr_reader(void *_count) rcu_register_thread(); urcu_posix_assert(!rcu_read_ongoing()); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -186,10 +154,7 @@ void *thr_writer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { new = malloc(sizeof(int)); @@ -337,13 +302,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_assign.c b/tests/benchmark/test_urcu_assign.c index 88889a8..d0272a7 100644 --- a/tests/benchmark/test_urcu_assign.c +++ b/tests/benchmark/test_urcu_assign.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_assign.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -48,8 +34,6 @@ struct test_array { int a; }; -static volatile int test_go, test_stop; - static unsigned long wdelay; static struct test_array *test_rcu_pointer; @@ -111,19 +95,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -201,10 +172,7 @@ void *thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -240,10 +208,7 @@ void *thr_writer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_copy_mutex_lock(); @@ -394,13 +359,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_bp.c b/tests/benchmark/test_urcu_bp.c index 6f8c59d..5da7132 100644 --- a/tests/benchmark/test_urcu_bp.c +++ b/tests/benchmark/test_urcu_bp.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -44,8 +30,6 @@ #endif #include -static volatile int test_go, test_stop; - static unsigned long wdelay; static int *test_rcu_pointer; @@ -107,19 +91,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -142,10 +113,7 @@ void *thr_reader(void *_count) rcu_register_thread(); urcu_posix_assert(!rcu_read_ongoing()); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -182,10 +150,7 @@ void *thr_writer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { new = malloc(sizeof(int)); @@ -332,13 +297,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_defer.c b/tests/benchmark/test_urcu_defer.c index e948ebf..56ac28d 100644 --- a/tests/benchmark/test_urcu_defer.c +++ b/tests/benchmark/test_urcu_defer.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_defer.c - * * Userspace RCU library - test program (with automatic reclamation) - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -49,8 +35,6 @@ struct test_array { int a; }; -static volatile int test_go, test_stop; - static unsigned long wdelay; static struct test_array *test_rcu_pointer; @@ -112,19 +96,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -149,10 +120,7 @@ void *thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -203,10 +171,7 @@ void *thr_writer(void *data) exit(-1); } - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { new = malloc(sizeof(*new)); @@ -359,13 +324,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_gc.c b/tests/benchmark/test_urcu_gc.c index f14f728..d52a51d 100644 --- a/tests/benchmark/test_urcu_gc.c +++ b/tests/benchmark/test_urcu_gc.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_gc.c - * * Userspace RCU library - test program (with batch reclamation) - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -33,6 +19,7 @@ #include #include #include +#include #include "thread-id.h" #include "../common/debug-yield.h" @@ -48,8 +35,6 @@ struct test_array { int a; }; -static volatile int test_go, test_stop; - static unsigned long wdelay; static struct test_array *test_rcu_pointer; @@ -120,19 +105,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -157,10 +129,7 @@ void *thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -231,10 +200,7 @@ void *thr_writer(void *data) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { #ifndef TEST_LOCAL_GC @@ -399,13 +365,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_hash.c b/tests/benchmark/test_urcu_hash.c index 3574b4c..606851b 100644 --- a/tests/benchmark/test_urcu_hash.c +++ b/tests/benchmark/test_urcu_hash.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_hash.c - * * Userspace RCU library - test program - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "test_urcu_hash.h" @@ -96,8 +82,6 @@ DEFINE_URCU_TLS(unsigned long, lookup_ok); struct cds_lfht *test_ht; -volatile int test_go, test_stop; - unsigned long wdelay; unsigned long duration; @@ -649,14 +633,14 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); remain = duration; do { remain = sleep(remain); } while (remain > 0); - test_stop = 1; + end_test(); end_pthread_join: for (i_thr = 0; i_thr < nr_readers_created; i_thr++) { diff --git a/tests/benchmark/test_urcu_hash.h b/tests/benchmark/test_urcu_hash.h index 47b2ae3..0ecb781 100644 --- a/tests/benchmark/test_urcu_hash.h +++ b/tests/benchmark/test_urcu_hash.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + #ifndef _TEST_URCU_HASH_H #define _TEST_URCU_HASH_H /* - * test_urcu_hash.h - * * Userspace RCU library - test program - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -125,8 +111,6 @@ cds_lfht_iter_get_test_node(struct cds_lfht_iter *iter) return to_test_node(cds_lfht_iter_get_node(iter)); } -extern volatile int test_go, test_stop; - extern unsigned long wdelay; extern unsigned long duration; @@ -174,19 +158,6 @@ extern pthread_mutex_t affinity_mutex; void set_affinity(void); -/* - * returns 0 if test should end. - */ -static inline int test_duration_write(void) -{ - return !test_stop; -} - -static inline int test_duration_read(void) -{ - return !test_stop; -} - extern DECLARE_URCU_TLS(unsigned long long, nr_writes); extern DECLARE_URCU_TLS(unsigned long long, nr_reads); diff --git a/tests/benchmark/test_urcu_hash_rw.c b/tests/benchmark/test_urcu_hash_rw.c index 862a6f0..b76603e 100644 --- a/tests/benchmark/test_urcu_hash_rw.c +++ b/tests/benchmark/test_urcu_hash_rw.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_hash_rw.c - * * Userspace RCU library - test program - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "test_urcu_hash.h" @@ -73,10 +59,7 @@ void *test_hash_rw_thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -133,10 +116,7 @@ void *test_hash_rw_thr_writer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_lfht_node *ret_node = NULL; diff --git a/tests/benchmark/test_urcu_hash_unique.c b/tests/benchmark/test_urcu_hash_unique.c index de7c427..487baa8 100644 --- a/tests/benchmark/test_urcu_hash_unique.c +++ b/tests/benchmark/test_urcu_hash_unique.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_hash_unique.c - * * Userspace RCU library - test program - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "test_urcu_hash.h" @@ -71,10 +57,7 @@ void *test_hash_unique_thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct lfht_test_node *node; @@ -136,10 +119,7 @@ void *test_hash_unique_thr_writer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { /* diff --git a/tests/benchmark/test_urcu_lfq.c b/tests/benchmark/test_urcu_lfq.c index 490e8b0..66cf78c 100644 --- a/tests/benchmark/test_urcu_lfq.c +++ b/tests/benchmark/test_urcu_lfq.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_lfq.c - * * Userspace RCU library - example RCU-based lock-free queue - * - * Copyright February 2010 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -47,8 +33,6 @@ #include #include -static volatile int test_go, test_stop; - static unsigned long rduration; static unsigned long duration; @@ -110,12 +94,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop; + return test_duration_read(); } static int test_duration_enqueue(void) { - return !test_stop; + return test_duration_write(); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -146,10 +130,7 @@ void *thr_enqueuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct test *node = malloc(sizeof(*node)); @@ -202,10 +183,7 @@ void *thr_dequeuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_lfq_node_rcu *qnode; @@ -375,7 +353,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -385,7 +363,7 @@ int main(int argc, char **argv) } } - test_stop = 1; + end_test(); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_lfs.c b/tests/benchmark/test_urcu_lfs.c index 52239e0..933f0b3 100644 --- a/tests/benchmark/test_urcu_lfs.c +++ b/tests/benchmark/test_urcu_lfs.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_lfs.c - * * Userspace RCU library - example lock-free stack - * - * Copyright 2010-2012 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -59,8 +45,6 @@ enum test_sync { static enum test_sync test_sync; -static volatile int test_go, test_stop; - static unsigned long rduration; static unsigned long duration; @@ -124,12 +108,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop; + return test_duration_read(); } static int test_duration_enqueue(void) { - return !test_stop; + return test_duration_write(); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -159,10 +143,7 @@ static void *thr_enqueuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct test *node = malloc(sizeof(*node)); @@ -261,10 +242,7 @@ static void *thr_dequeuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); urcu_posix_assert(test_pop || test_pop_all); @@ -459,7 +437,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -469,7 +447,7 @@ int main(int argc, char **argv) } } - test_stop = 1; + end_test(); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_lfs_rcu.c b/tests/benchmark/test_urcu_lfs_rcu.c index 7975faf..cb9236d 100644 --- a/tests/benchmark/test_urcu_lfs_rcu.c +++ b/tests/benchmark/test_urcu_lfs_rcu.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_lfs_rcu.c - * * Userspace RCU library - example RCU-based lock-free stack - * - * Copyright February 2010 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -51,8 +37,6 @@ #include -static volatile int test_go, test_stop; - static unsigned long rduration; static unsigned long duration; @@ -114,12 +98,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop; + return test_duration_read(); } static int test_duration_enqueue(void) { - return !test_stop; + return test_duration_write(); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -150,10 +134,7 @@ void *thr_enqueuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct test *node = malloc(sizeof(*node)); @@ -205,10 +186,7 @@ void *thr_dequeuer(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_lfs_node_rcu *snode; @@ -377,7 +355,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -387,7 +365,7 @@ int main(int argc, char **argv) } } - test_stop = 1; + end_test(); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_qsbr.c b/tests/benchmark/test_urcu_qsbr.c index 1ea369c..a33dbd3 100644 --- a/tests/benchmark/test_urcu_qsbr.c +++ b/tests/benchmark/test_urcu_qsbr.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -44,8 +30,6 @@ #endif #include "urcu-qsbr.h" -static volatile int test_go, test_stop; - static unsigned long wdelay; static int *test_rcu_pointer; @@ -106,19 +90,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -145,10 +116,7 @@ void *thr_reader(void *_count) urcu_posix_assert(!rcu_read_ongoing()); rcu_thread_online(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { rcu_read_lock(); @@ -192,10 +160,7 @@ void *thr_writer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { new = malloc(sizeof(int)); @@ -343,13 +308,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_qsbr_gc.c b/tests/benchmark/test_urcu_qsbr_gc.c index 8877a82..00f6757 100644 --- a/tests/benchmark/test_urcu_qsbr_gc.c +++ b/tests/benchmark/test_urcu_qsbr_gc.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_gc.c - * * Userspace RCU library - test program (with baatch reclamation) - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -33,6 +19,7 @@ #include #include #include +#include #include "thread-id.h" #include "../common/debug-yield.h" @@ -46,8 +33,6 @@ struct test_array { int a; }; -static volatile int test_go, test_stop; - static unsigned long wdelay; static struct test_array *test_rcu_pointer; @@ -118,19 +103,6 @@ static void set_affinity(void) #endif /* HAVE_SCHED_SETAFFINITY */ } -/* - * returns 0 if test should end. - */ -static int test_duration_write(void) -{ - return !test_stop; -} - -static int test_duration_read(void) -{ - return !test_stop; -} - static DEFINE_URCU_TLS(unsigned long long, nr_writes); static DEFINE_URCU_TLS(unsigned long long, nr_reads); @@ -154,10 +126,7 @@ void *thr_reader(void *_count) rcu_register_thread(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { _rcu_read_lock(); @@ -231,10 +200,7 @@ void *thr_writer(void *data) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { #ifndef TEST_LOCAL_GC @@ -399,13 +365,7 @@ int main(int argc, char **argv) exit(1); } - cmm_smp_mb(); - - test_go = 1; - - sleep(duration); - - test_stop = 1; + test_for(duration); for (i_thr = 0; i_thr < nr_readers; i_thr++) { err = pthread_join(tid_reader[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_qsbr_timing.c b/tests/benchmark/test_urcu_qsbr_timing.c index 09b9ca9..00de939 100644 --- a/tests/benchmark/test_urcu_qsbr_timing.c +++ b/tests/benchmark/test_urcu_qsbr_timing.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_qsbr_timing.c - * * Userspace QSBR - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_urcu_timing.c b/tests/benchmark/test_urcu_timing.c index 35b0e80..6ab390d 100644 --- a/tests/benchmark/test_urcu_timing.c +++ b/tests/benchmark/test_urcu_timing.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu.c - * * Userspace RCU library - test program - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/benchmark/test_urcu_wfcq.c b/tests/benchmark/test_urcu_wfcq.c index 2c6e0fd..71bca10 100644 --- a/tests/benchmark/test_urcu_wfcq.c +++ b/tests/benchmark/test_urcu_wfcq.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_wfcq.c - * * Userspace RCU library - example RCU-based lock-free concurrent queue - * - * Copyright February 2010 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -56,7 +42,7 @@ static enum test_sync test_sync; static int test_force_sync; -static volatile int test_go, test_stop_enqueue, test_stop_dequeue; +static volatile int test_stop_enqueue, test_stop_dequeue; static unsigned long rduration; @@ -122,12 +108,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop_dequeue; + return !uatomic_load(&test_stop_dequeue, CMM_RELAXED); } static int test_duration_enqueue(void) { - return !test_stop_enqueue; + return !uatomic_load(&test_stop_enqueue, CMM_RELAXED); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -155,10 +141,7 @@ static void *thr_enqueuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_wfcq_node *node = malloc(sizeof(*node)); @@ -266,10 +249,7 @@ static void *thr_dequeuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { if (test_dequeue && test_splice) { @@ -482,7 +462,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -492,7 +472,7 @@ int main(int argc, char **argv) } } - test_stop_enqueue = 1; + uatomic_store(&test_stop_enqueue, 1, CMM_RELEASE); if (test_wait_empty) { while (nr_enqueuers != uatomic_read(&test_enqueue_stopped)) { @@ -503,7 +483,7 @@ int main(int argc, char **argv) } } - test_stop_dequeue = 1; + uatomic_store(&test_stop_dequeue, 1, CMM_RELAXED); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_wfq.c b/tests/benchmark/test_urcu_wfq.c index 8381160..b17df5a 100644 --- a/tests/benchmark/test_urcu_wfq.c +++ b/tests/benchmark/test_urcu_wfq.c @@ -1,24 +1,10 @@ +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_wfq.c - * * Userspace RCU library - example RCU-based lock-free queue - * - * Copyright February 2010 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -51,8 +37,6 @@ #include #include -static volatile int test_go, test_stop; - static unsigned long rduration; static unsigned long duration; @@ -114,12 +98,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop; + return test_duration_read(); } static int test_duration_enqueue(void) { - return !test_stop; + return test_duration_write(); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -143,10 +127,7 @@ void *thr_enqueuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_wfq_node *node = malloc(sizeof(*node)); @@ -185,10 +166,7 @@ void *thr_dequeuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_wfq_node *node = cds_wfq_dequeue_blocking(&q); @@ -343,7 +321,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -353,7 +331,7 @@ int main(int argc, char **argv) } } - test_stop = 1; + end_test(); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/test_urcu_wfs.c b/tests/benchmark/test_urcu_wfs.c index c285feb..39704f4 100644 --- a/tests/benchmark/test_urcu_wfs.c +++ b/tests/benchmark/test_urcu_wfs.c @@ -1,24 +1,10 @@ -/* - * test_urcu_wfs.c - * +// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: GPL-2.0-or-later + + /* * Userspace RCU library - example RCU-based lock-free stack - * - * Copyright February 2010 - Mathieu Desnoyers - * Copyright February 2010 - Paolo Bonzini - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -59,7 +45,7 @@ static enum test_sync test_sync; static int test_force_sync; -static volatile int test_go, test_stop_enqueue, test_stop_dequeue; +static volatile int test_stop_enqueue, test_stop_dequeue; static unsigned long rduration; @@ -125,12 +111,12 @@ static void set_affinity(void) */ static int test_duration_dequeue(void) { - return !test_stop_dequeue; + return !uatomic_load(&test_stop_dequeue, CMM_RELAXED); } static int test_duration_enqueue(void) { - return !test_stop_enqueue; + return !uatomic_load(&test_stop_enqueue, CMM_RELAXED); } static DEFINE_URCU_TLS(unsigned long long, nr_dequeues); @@ -157,10 +143,7 @@ static void *thr_enqueuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); for (;;) { struct cds_wfs_node *node = malloc(sizeof(*node)); @@ -250,10 +233,7 @@ static void *thr_dequeuer(void *_count) set_affinity(); - while (!test_go) - { - } - cmm_smp_mb(); + wait_until_go(); urcu_posix_assert(test_pop || test_pop_all); @@ -469,7 +449,7 @@ int main(int argc, char **argv) cmm_smp_mb(); - test_go = 1; + begin_test(); for (i_thr = 0; i_thr < duration; i_thr++) { sleep(1); @@ -479,7 +459,7 @@ int main(int argc, char **argv) } } - test_stop_enqueue = 1; + uatomic_store(&test_stop_enqueue, 1, CMM_RELEASE); if (test_wait_empty) { while (nr_enqueuers != uatomic_read(&test_enqueue_stopped)) { @@ -490,7 +470,7 @@ int main(int argc, char **argv) } } - test_stop_dequeue = 1; + uatomic_store(&test_stop_dequeue, 1, CMM_RELAXED); for (i_thr = 0; i_thr < nr_enqueuers; i_thr++) { err = pthread_join(tid_enqueuer[i_thr], &tret); diff --git a/tests/benchmark/urcu_1_seconds.tap b/tests/benchmark/urcu_1_seconds.tap index 8553ed9..8d229bf 100755 --- a/tests/benchmark/urcu_1_seconds.tap +++ b/tests/benchmark/urcu_1_seconds.tap @@ -1 +1,18 @@ -./run-urcu-tests.sh 1 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/run-urcu-tests.sh" 1 diff --git a/tests/benchmark/urcu_30_seconds.tap b/tests/benchmark/urcu_30_seconds.tap index 5c13dd9..da8aae1 100755 --- a/tests/benchmark/urcu_30_seconds.tap +++ b/tests/benchmark/urcu_30_seconds.tap @@ -1 +1,18 @@ -./run-urcu-tests.sh 30 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/run-urcu-tests.sh" 30 diff --git a/tests/benchmark/urcu_3_seconds.tap b/tests/benchmark/urcu_3_seconds.tap index 51f4412..0ec6ebb 100755 --- a/tests/benchmark/urcu_3_seconds.tap +++ b/tests/benchmark/urcu_3_seconds.tap @@ -1 +1,18 @@ -./run-urcu-tests.sh 3 +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"$URCU_TESTS_SRCDIR/benchmark/run-urcu-tests.sh" 3 diff --git a/tests/common/Makefile.am b/tests/common/Makefile.am index bfd5d57..af6d89f 100644 --- a/tests/common/Makefile.am +++ b/tests/common/Makefile.am @@ -1,9 +1,14 @@ -AM_CPPFLAGS += -I$(top_srcdir)/src +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT -noinst_HEADERS = thread-id.h +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/common + +noinst_HEADERS = \ + api.h \ + compat-rand.h \ + thread-id.h noinst_LTLIBRARIES = libdebug-yield.la libdebug_yield_la_SOURCES = debug-yield.c debug-yield.h - -EXTRA_DIST = api.h diff --git a/tests/common/api.h b/tests/common/api.h index a260463..ec3ce1e 100644 --- a/tests/common/api.h +++ b/tests/common/api.h @@ -1,31 +1,20 @@ +// SPDX-FileCopyrightText: 2006 Paul E. McKenney, IBM. +// +// SPDX-License-Identifier: GPL-2.0-only + #ifndef _INCLUDE_API_H #define _INCLUDE_API_H /* * common.h: Common Linux kernel-isms. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; but version 2 of the License only due - * to code included from the Linux kernel. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (c) 2006 Paul E. McKenney, IBM. - * * Much code taken from the Linux kernel. For such code, the option * to redistribute under later versions of GPL might not be available. */ #include #include +#include /* * Machine parameters. @@ -34,27 +23,6 @@ #define ____cacheline_internodealigned_in_smp \ __attribute__((__aligned__(CAA_CACHE_LINE_SIZE))) -/* - * api_pthreads.h: API mapping to pthreads environment. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. However, please note that much - * of the code in this file derives from the Linux kernel, and that such - * code may not be available except under GPLv2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright (c) 2006 Paul E. McKenney, IBM. - */ #include #include @@ -135,7 +103,7 @@ static int __smp_thread_id(void) thread_id_t tid = pthread_self(); for (i = 0; i < NR_THREADS; i++) { - if (__thread_id_map[i] == tid) { + if (uatomic_read(&__thread_id_map[i]) == tid) { long v = i + 1; /* must be non-NULL. */ if (pthread_setspecific(thread_id_key, (void *)v) != 0) { @@ -184,12 +152,13 @@ static thread_id_t create_thread(void *(*func)(void *), void *arg) exit(-1); } __thread_id_map[i] = __THREAD_ID_MAP_WAITING; - spin_unlock(&__thread_id_map_mutex); + if (pthread_create(&tid, NULL, func, arg) != 0) { perror("create_thread:pthread_create"); exit(-1); } - __thread_id_map[i] = tid; + uatomic_set(&__thread_id_map[i], tid); + spin_unlock(&__thread_id_map_mutex); return tid; } @@ -199,7 +168,7 @@ static void *wait_thread(thread_id_t tid) void *vp; for (i = 0; i < NR_THREADS; i++) { - if (__thread_id_map[i] == tid) + if (uatomic_read(&__thread_id_map[i]) == tid) break; } if (i >= NR_THREADS){ @@ -211,7 +180,7 @@ static void *wait_thread(thread_id_t tid) perror("wait_thread:pthread_join"); exit(-1); } - __thread_id_map[i] = __THREAD_ID_MAP_EMPTY; + uatomic_set(&__thread_id_map[i], __THREAD_ID_MAP_EMPTY); return vp; } diff --git a/tests/common/compat-rand.h b/tests/common/compat-rand.h new file mode 100644 index 0000000..42fbb30 --- /dev/null +++ b/tests/common/compat-rand.h @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: 1996 Ulrich Drepper +// SPDX-FileCopyrightText: 2013 Pierre-Luc St-Charles +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef _COMPAT_RAND_H +#define _COMPAT_RAND_H + +/* + * Userspace RCU library - rand/rand_r Compatibility Header + * + * Note: this file is only used to simplify the code required to + * use the 'rand_r(...)' system function across multiple platforms, + * which might not always be referenced the same way. + */ + +#ifndef HAVE_RAND_R +/* + * Reentrant random function from POSIX.1c. + * Copyright (C) 1996, 1999 Free Software Foundation, Inc. + * This file is part of the GNU C Library. + * Contributed by Ulrich Drepper >, 1996. + */ +static inline int rand_r(unsigned int *seed) +{ + unsigned int next = *seed; + int result; + + next *= 1103515245; + next += 12345; + result = (unsigned int) (next / 65536) % 2048; + + next *= 1103515245; + next += 12345; + result <<= 10; + result ^= (unsigned int) (next / 65536) % 1024; + + next *= 1103515245; + next += 12345; + result <<= 10; + result ^= (unsigned int) (next / 65536) % 1024; + + *seed = next; + + return result; +} +#endif /* HAVE_RAND_R */ + +#endif /* _COMPAT_RAND_H */ diff --git a/tests/common/debug-yield.c b/tests/common/debug-yield.c index 8f06a9d..16205a4 100644 --- a/tests/common/debug-yield.c +++ b/tests/common/debug-yield.c @@ -1,25 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + /* - * debug-yield.c - * * Userspace RCU library tests - Debugging code * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ diff --git a/tests/common/debug-yield.h b/tests/common/debug-yield.h index 7f1b58a..7d4f62a 100644 --- a/tests/common/debug-yield.h +++ b/tests/common/debug-yield.h @@ -1,28 +1,14 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: LGPL-2.1-or-later + #ifndef URCU_TESTS_DEBUG_YIELD_H #define URCU_TESTS_DEBUG_YIELD_H /* - * debug-yield.h - * * Userspace RCU library tests - Debugging header * - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ @@ -36,15 +22,7 @@ #define RCU_YIELD_READ (1 << 0) #define RCU_YIELD_WRITE (1 << 1) -/* - * Updates with RCU_SIGNAL are much slower. Account this in the delay. - */ -#ifdef RCU_SIGNAL -/* maximum sleep delay, in us */ -#define MAX_SLEEP 30000 -#else #define MAX_SLEEP 50 -#endif extern unsigned int rcu_yield_active; extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield); diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index cb0d903..575acaf 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -1,21 +1,12 @@ +// SPDX-FileCopyrightText: 2013 Mathieu Desnoyers +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _TEST_THREAD_ID_H #define _TEST_THREAD_ID_H /* - * thread-id.h - * * Userspace RCU library - thread ID - * - * Copyright 2013 - Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. */ #ifdef __linux__ @@ -68,7 +59,14 @@ unsigned long urcu_get_thread_id(void) pthread_t thr = pthread_self(); return pthread_getsequence_np(&thr); } +#elif defined(__OpenBSD__) +#include +static inline +unsigned long urcu_get_thread_id(void) +{ + return (unsigned long) getthrid(); +} #else # warning "use pid as thread ID" static inline diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am index b8d4acf..93c35ef 100644 --- a/tests/regression/Makefile.am +++ b/tests/regression/Makefile.am @@ -1,17 +1,21 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common TEST_EXTENSIONS = .tap TAP_LOG_DRIVER_FLAGS = --merge --comments -TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ - $(top_srcdir)/tests/utils/tap-driver.sh +TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \ + URCU_TESTS_SRCDIR='$(abs_top_srcdir)/tests' \ + URCU_TESTS_BUILDDIR='$(abs_top_builddir)/tests' \ + $(SHELL) $(top_srcdir)/tests/utils/tap-driver.sh noinst_PROGRAMS = \ test_urcu_fork.tap \ test_urcu_fork_cxx.tap \ rcutorture_urcu_membarrier \ rcutorture_urcu_membarrier_cxx \ - rcutorture_urcu_signal \ - rcutorture_urcu_signal_cxx \ rcutorture_urcu_mb \ rcutorture_urcu_mb_cxx \ rcutorture_urcu_bp \ @@ -25,7 +29,6 @@ URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la URCU_LIB=$(top_builddir)/src/liburcu.la URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la TAP_LIB=$(top_builddir)/tests/utils/libtap.a @@ -60,14 +63,6 @@ rcutorture_urcu_qsbr_cxx_SOURCES = urcutorture_cxx.cpp rcutorture_urcu_qsbr_cxx_CXXFLAGS = -DTORTURE_QSBR -DRCU_QSBR $(AM_CXXFLAGS) rcutorture_urcu_qsbr_cxx_LDADD = $(URCU_QSBR_LIB) $(TAP_LIB) -rcutorture_urcu_signal_SOURCES = urcutorture.c -rcutorture_urcu_signal_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS) -rcutorture_urcu_signal_LDADD = $(URCU_SIGNAL_LIB) $(TAP_LIB) - -rcutorture_urcu_signal_cxx_SOURCES = urcutorture_cxx.cpp -rcutorture_urcu_signal_cxx_CXXFLAGS = -DRCU_SIGNAL $(AM_CXXFLAGS) -rcutorture_urcu_signal_cxx_LDADD = $(URCU_SIGNAL_LIB) $(TAP_LIB) - rcutorture_urcu_bp_SOURCES = urcutorture.c rcutorture_urcu_bp_CFLAGS = -DRCU_BP $(AM_CFLAGS) rcutorture_urcu_bp_LDADD = $(URCU_BP_LIB) $(TAP_LIB) @@ -78,6 +73,104 @@ rcutorture_urcu_bp_cxx_LDADD = $(URCU_BP_LIB) $(TAP_LIB) urcutorture.c: ../common/api.h +dist_check_SCRIPTS = \ + test_rcutorture_urcu_bp_perf_global.tap \ + test_rcutorture_urcu_bp_perf_global_cxx.tap \ + test_rcutorture_urcu_bp_perf_percpu.tap \ + test_rcutorture_urcu_bp_perf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_perf_perthread.tap \ + test_rcutorture_urcu_bp_perf_perthread_cxx.tap \ + test_rcutorture_urcu_bp_rperf_global.tap \ + test_rcutorture_urcu_bp_rperf_global_cxx.tap \ + test_rcutorture_urcu_bp_rperf_percpu.tap \ + test_rcutorture_urcu_bp_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_rperf_perthread.tap \ + test_rcutorture_urcu_bp_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_bp_stress_global.tap \ + test_rcutorture_urcu_bp_stress_global_cxx.tap \ + test_rcutorture_urcu_bp_stress_percpu.tap \ + test_rcutorture_urcu_bp_stress_percpu_cxx.tap \ + test_rcutorture_urcu_bp_stress_perthread.tap \ + test_rcutorture_urcu_bp_stress_perthread_cxx.tap \ + test_rcutorture_urcu_bp_uperf_global.tap \ + test_rcutorture_urcu_bp_uperf_global_cxx.tap \ + test_rcutorture_urcu_bp_uperf_percpu.tap \ + test_rcutorture_urcu_bp_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_uperf_perthread.tap \ + test_rcutorture_urcu_bp_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_perf_global.tap \ + test_rcutorture_urcu_mb_perf_global_cxx.tap \ + test_rcutorture_urcu_mb_perf_percpu.tap \ + test_rcutorture_urcu_mb_perf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_perf_perthread.tap \ + test_rcutorture_urcu_mb_perf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_rperf_global.tap \ + test_rcutorture_urcu_mb_rperf_global_cxx.tap \ + test_rcutorture_urcu_mb_rperf_percpu.tap \ + test_rcutorture_urcu_mb_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_rperf_perthread.tap \ + test_rcutorture_urcu_mb_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_stress_global.tap \ + test_rcutorture_urcu_mb_stress_global_cxx.tap \ + test_rcutorture_urcu_mb_stress_percpu.tap \ + test_rcutorture_urcu_mb_stress_percpu_cxx.tap \ + test_rcutorture_urcu_mb_stress_perthread.tap \ + test_rcutorture_urcu_mb_stress_perthread_cxx.tap \ + test_rcutorture_urcu_mb_uperf_global.tap \ + test_rcutorture_urcu_mb_uperf_global_cxx.tap \ + test_rcutorture_urcu_mb_uperf_percpu.tap \ + test_rcutorture_urcu_mb_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_uperf_perthread.tap \ + test_rcutorture_urcu_mb_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_global.tap \ + test_rcutorture_urcu_membarrier_perf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_percpu.tap \ + test_rcutorture_urcu_membarrier_perf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_perthread.tap \ + test_rcutorture_urcu_membarrier_perf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_global.tap \ + test_rcutorture_urcu_membarrier_rperf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_percpu.tap \ + test_rcutorture_urcu_membarrier_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_perthread.tap \ + test_rcutorture_urcu_membarrier_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_global.tap \ + test_rcutorture_urcu_membarrier_stress_global_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_percpu.tap \ + test_rcutorture_urcu_membarrier_stress_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_perthread.tap \ + test_rcutorture_urcu_membarrier_stress_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_global.tap \ + test_rcutorture_urcu_membarrier_uperf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_percpu.tap \ + test_rcutorture_urcu_membarrier_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_perthread.tap \ + test_rcutorture_urcu_membarrier_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_global.tap \ + test_rcutorture_urcu_qsbr_perf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_percpu.tap \ + test_rcutorture_urcu_qsbr_perf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_perthread.tap \ + test_rcutorture_urcu_qsbr_perf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_global.tap \ + test_rcutorture_urcu_qsbr_rperf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_percpu.tap \ + test_rcutorture_urcu_qsbr_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_perthread.tap \ + test_rcutorture_urcu_qsbr_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_global.tap \ + test_rcutorture_urcu_qsbr_stress_global_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_percpu.tap \ + test_rcutorture_urcu_qsbr_stress_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_perthread.tap \ + test_rcutorture_urcu_qsbr_stress_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_global.tap \ + test_rcutorture_urcu_qsbr_uperf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_percpu.tap \ + test_rcutorture_urcu_qsbr_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_perthread.tap \ + test_rcutorture_urcu_qsbr_uperf_perthread_cxx.tap + .PHONY: regtest # This empty variable is required to enable the TAP test suite for custom @@ -87,126 +180,102 @@ TESTS = REGTEST_TESTS = \ test_urcu_fork.tap \ test_urcu_fork_cxx.tap \ - rcutorture_urcu_bp_perf_global.tap \ - rcutorture_urcu_bp_perf_global_cxx.tap \ - rcutorture_urcu_bp_perf_percpu.tap \ - rcutorture_urcu_bp_perf_percpu_cxx.tap \ - rcutorture_urcu_bp_perf_perthread.tap \ - rcutorture_urcu_bp_perf_perthread_cxx.tap \ - rcutorture_urcu_bp_rperf_global.tap \ - rcutorture_urcu_bp_rperf_global_cxx.tap \ - rcutorture_urcu_bp_rperf_percpu.tap \ - rcutorture_urcu_bp_rperf_percpu_cxx.tap \ - rcutorture_urcu_bp_rperf_perthread.tap \ - rcutorture_urcu_bp_rperf_perthread_cxx.tap \ - rcutorture_urcu_bp_stress_global.tap \ - rcutorture_urcu_bp_stress_global_cxx.tap \ - rcutorture_urcu_bp_stress_percpu.tap \ - rcutorture_urcu_bp_stress_percpu_cxx.tap \ - rcutorture_urcu_bp_stress_perthread.tap \ - rcutorture_urcu_bp_stress_perthread_cxx.tap \ - rcutorture_urcu_bp_uperf_global.tap \ - rcutorture_urcu_bp_uperf_global_cxx.tap \ - rcutorture_urcu_bp_uperf_percpu.tap \ - rcutorture_urcu_bp_uperf_percpu_cxx.tap \ - rcutorture_urcu_bp_uperf_perthread.tap \ - rcutorture_urcu_bp_uperf_perthread_cxx.tap \ - rcutorture_urcu_mb_perf_global.tap \ - rcutorture_urcu_mb_perf_global_cxx.tap \ - rcutorture_urcu_mb_perf_percpu.tap \ - rcutorture_urcu_mb_perf_percpu_cxx.tap \ - rcutorture_urcu_mb_perf_perthread.tap \ - rcutorture_urcu_mb_perf_perthread_cxx.tap \ - rcutorture_urcu_mb_rperf_global.tap \ - rcutorture_urcu_mb_rperf_global_cxx.tap \ - rcutorture_urcu_mb_rperf_percpu.tap \ - rcutorture_urcu_mb_rperf_percpu_cxx.tap \ - rcutorture_urcu_mb_rperf_perthread.tap \ - rcutorture_urcu_mb_rperf_perthread_cxx.tap \ - rcutorture_urcu_mb_stress_global.tap \ - rcutorture_urcu_mb_stress_global_cxx.tap \ - rcutorture_urcu_mb_stress_percpu.tap \ - rcutorture_urcu_mb_stress_percpu_cxx.tap \ - rcutorture_urcu_mb_stress_perthread.tap \ - rcutorture_urcu_mb_stress_perthread_cxx.tap \ - rcutorture_urcu_mb_uperf_global.tap \ - rcutorture_urcu_mb_uperf_global_cxx.tap \ - rcutorture_urcu_mb_uperf_percpu.tap \ - rcutorture_urcu_mb_uperf_percpu_cxx.tap \ - rcutorture_urcu_mb_uperf_perthread.tap \ - rcutorture_urcu_mb_uperf_perthread_cxx.tap \ - rcutorture_urcu_membarrier_perf_global.tap \ - rcutorture_urcu_membarrier_perf_global_cxx.tap \ - rcutorture_urcu_membarrier_perf_percpu.tap \ - rcutorture_urcu_membarrier_perf_percpu_cxx.tap \ - rcutorture_urcu_membarrier_perf_perthread.tap \ - rcutorture_urcu_membarrier_perf_perthread_cxx.tap \ - rcutorture_urcu_membarrier_rperf_global.tap \ - rcutorture_urcu_membarrier_rperf_global_cxx.tap \ - rcutorture_urcu_membarrier_rperf_percpu.tap \ - rcutorture_urcu_membarrier_rperf_percpu_cxx.tap \ - rcutorture_urcu_membarrier_rperf_perthread.tap \ - rcutorture_urcu_membarrier_rperf_perthread_cxx.tap \ - rcutorture_urcu_membarrier_stress_global.tap \ - rcutorture_urcu_membarrier_stress_global_cxx.tap \ - rcutorture_urcu_membarrier_stress_percpu.tap \ - rcutorture_urcu_membarrier_stress_percpu_cxx.tap \ - rcutorture_urcu_membarrier_stress_perthread.tap \ - rcutorture_urcu_membarrier_stress_perthread_cxx.tap \ - rcutorture_urcu_membarrier_uperf_global.tap \ - rcutorture_urcu_membarrier_uperf_global_cxx.tap \ - rcutorture_urcu_membarrier_uperf_percpu.tap \ - rcutorture_urcu_membarrier_uperf_percpu_cxx.tap \ - rcutorture_urcu_membarrier_uperf_perthread.tap \ - rcutorture_urcu_membarrier_uperf_perthread_cxx.tap \ - rcutorture_urcu_qsbr_perf_global.tap \ - rcutorture_urcu_qsbr_perf_global_cxx.tap \ - rcutorture_urcu_qsbr_perf_percpu.tap \ - rcutorture_urcu_qsbr_perf_percpu_cxx.tap \ - rcutorture_urcu_qsbr_perf_perthread.tap \ - rcutorture_urcu_qsbr_perf_perthread_cxx.tap \ - rcutorture_urcu_qsbr_rperf_global.tap \ - rcutorture_urcu_qsbr_rperf_global_cxx.tap \ - rcutorture_urcu_qsbr_rperf_percpu.tap \ - rcutorture_urcu_qsbr_rperf_percpu_cxx.tap \ - rcutorture_urcu_qsbr_rperf_perthread.tap \ - rcutorture_urcu_qsbr_rperf_perthread_cxx.tap \ - rcutorture_urcu_qsbr_stress_global.tap \ - rcutorture_urcu_qsbr_stress_global_cxx.tap \ - rcutorture_urcu_qsbr_stress_percpu.tap \ - rcutorture_urcu_qsbr_stress_percpu_cxx.tap \ - rcutorture_urcu_qsbr_stress_perthread.tap \ - rcutorture_urcu_qsbr_stress_perthread_cxx.tap \ - rcutorture_urcu_qsbr_uperf_global.tap \ - rcutorture_urcu_qsbr_uperf_global_cxx.tap \ - rcutorture_urcu_qsbr_uperf_percpu.tap \ - rcutorture_urcu_qsbr_uperf_percpu_cxx.tap \ - rcutorture_urcu_qsbr_uperf_perthread.tap \ - rcutorture_urcu_qsbr_uperf_perthread_cxx.tap \ - rcutorture_urcu_signal_perf_global.tap \ - rcutorture_urcu_signal_perf_global_cxx.tap \ - rcutorture_urcu_signal_perf_percpu.tap \ - rcutorture_urcu_signal_perf_percpu_cxx.tap \ - rcutorture_urcu_signal_perf_perthread.tap \ - rcutorture_urcu_signal_perf_perthread_cxx.tap \ - rcutorture_urcu_signal_rperf_global.tap \ - rcutorture_urcu_signal_rperf_global_cxx.tap \ - rcutorture_urcu_signal_rperf_percpu.tap \ - rcutorture_urcu_signal_rperf_percpu_cxx.tap \ - rcutorture_urcu_signal_rperf_perthread.tap \ - rcutorture_urcu_signal_rperf_perthread_cxx.tap \ - rcutorture_urcu_signal_stress_global.tap \ - rcutorture_urcu_signal_stress_global_cxx.tap \ - rcutorture_urcu_signal_stress_percpu.tap \ - rcutorture_urcu_signal_stress_percpu_cxx.tap \ - rcutorture_urcu_signal_stress_perthread.tap \ - rcutorture_urcu_signal_stress_perthread_cxx.tap \ - rcutorture_urcu_signal_uperf_global.tap \ - rcutorture_urcu_signal_uperf_global_cxx.tap \ - rcutorture_urcu_signal_uperf_percpu.tap \ - rcutorture_urcu_signal_uperf_percpu_cxx.tap \ - rcutorture_urcu_signal_uperf_perthread.tap \ - rcutorture_urcu_signal_uperf_perthread_cxx.tap + test_rcutorture_urcu_bp_perf_global.tap \ + test_rcutorture_urcu_bp_perf_global_cxx.tap \ + test_rcutorture_urcu_bp_perf_percpu.tap \ + test_rcutorture_urcu_bp_perf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_perf_perthread.tap \ + test_rcutorture_urcu_bp_perf_perthread_cxx.tap \ + test_rcutorture_urcu_bp_rperf_global.tap \ + test_rcutorture_urcu_bp_rperf_global_cxx.tap \ + test_rcutorture_urcu_bp_rperf_percpu.tap \ + test_rcutorture_urcu_bp_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_rperf_perthread.tap \ + test_rcutorture_urcu_bp_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_bp_stress_global.tap \ + test_rcutorture_urcu_bp_stress_global_cxx.tap \ + test_rcutorture_urcu_bp_stress_percpu.tap \ + test_rcutorture_urcu_bp_stress_percpu_cxx.tap \ + test_rcutorture_urcu_bp_stress_perthread.tap \ + test_rcutorture_urcu_bp_stress_perthread_cxx.tap \ + test_rcutorture_urcu_bp_uperf_global.tap \ + test_rcutorture_urcu_bp_uperf_global_cxx.tap \ + test_rcutorture_urcu_bp_uperf_percpu.tap \ + test_rcutorture_urcu_bp_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_bp_uperf_perthread.tap \ + test_rcutorture_urcu_bp_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_perf_global.tap \ + test_rcutorture_urcu_mb_perf_global_cxx.tap \ + test_rcutorture_urcu_mb_perf_percpu.tap \ + test_rcutorture_urcu_mb_perf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_perf_perthread.tap \ + test_rcutorture_urcu_mb_perf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_rperf_global.tap \ + test_rcutorture_urcu_mb_rperf_global_cxx.tap \ + test_rcutorture_urcu_mb_rperf_percpu.tap \ + test_rcutorture_urcu_mb_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_rperf_perthread.tap \ + test_rcutorture_urcu_mb_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_mb_stress_global.tap \ + test_rcutorture_urcu_mb_stress_global_cxx.tap \ + test_rcutorture_urcu_mb_stress_percpu.tap \ + test_rcutorture_urcu_mb_stress_percpu_cxx.tap \ + test_rcutorture_urcu_mb_stress_perthread.tap \ + test_rcutorture_urcu_mb_stress_perthread_cxx.tap \ + test_rcutorture_urcu_mb_uperf_global.tap \ + test_rcutorture_urcu_mb_uperf_global_cxx.tap \ + test_rcutorture_urcu_mb_uperf_percpu.tap \ + test_rcutorture_urcu_mb_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_mb_uperf_perthread.tap \ + test_rcutorture_urcu_mb_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_global.tap \ + test_rcutorture_urcu_membarrier_perf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_percpu.tap \ + test_rcutorture_urcu_membarrier_perf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_perf_perthread.tap \ + test_rcutorture_urcu_membarrier_perf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_global.tap \ + test_rcutorture_urcu_membarrier_rperf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_percpu.tap \ + test_rcutorture_urcu_membarrier_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_rperf_perthread.tap \ + test_rcutorture_urcu_membarrier_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_global.tap \ + test_rcutorture_urcu_membarrier_stress_global_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_percpu.tap \ + test_rcutorture_urcu_membarrier_stress_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_stress_perthread.tap \ + test_rcutorture_urcu_membarrier_stress_perthread_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_global.tap \ + test_rcutorture_urcu_membarrier_uperf_global_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_percpu.tap \ + test_rcutorture_urcu_membarrier_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_membarrier_uperf_perthread.tap \ + test_rcutorture_urcu_membarrier_uperf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_global.tap \ + test_rcutorture_urcu_qsbr_perf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_percpu.tap \ + test_rcutorture_urcu_qsbr_perf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_perf_perthread.tap \ + test_rcutorture_urcu_qsbr_perf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_global.tap \ + test_rcutorture_urcu_qsbr_rperf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_percpu.tap \ + test_rcutorture_urcu_qsbr_rperf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_rperf_perthread.tap \ + test_rcutorture_urcu_qsbr_rperf_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_global.tap \ + test_rcutorture_urcu_qsbr_stress_global_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_percpu.tap \ + test_rcutorture_urcu_qsbr_stress_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_stress_perthread.tap \ + test_rcutorture_urcu_qsbr_stress_perthread_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_global.tap \ + test_rcutorture_urcu_qsbr_uperf_global_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_percpu.tap \ + test_rcutorture_urcu_qsbr_uperf_percpu_cxx.tap \ + test_rcutorture_urcu_qsbr_uperf_perthread.tap \ + test_rcutorture_urcu_qsbr_uperf_perthread_cxx.tap regtest: $(MAKE) $(AM_MAKEFLAGS) check TESTS="$(REGTEST_TESTS)" diff --git a/tests/regression/rcutorture.h b/tests/regression/rcutorture.h index 639fcfc..441ff79 100644 --- a/tests/regression/rcutorture.h +++ b/tests/regression/rcutorture.h @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2008 Paul E. McKenney, IBM Corporation. +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* * rcutorture.h: simple user-level performance/stress test of RCU. * @@ -44,6 +48,14 @@ * data. A correct RCU implementation will have all but the first two * numbers non-zero. * + * rcu_stress_count: Histogram of "ages" of structures seen by readers. If any + * entries past the first two are non-zero, RCU is broken. The age of a newly + * allocated structure is zero, it becomes one when removed from reader + * visibility, and is incremented once per grace period subsequently -- and is + * freed after passing through (RCU_STRESS_PIPE_LEN-2) grace periods. Since + * this tests only has one true writer (there are fake writers), only buckets at + * indexes 0 and 1 should be none-zero. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -68,6 +80,10 @@ #include #include "tap.h" +#include + +#include "urcu-wait.h" + #define NR_TESTS 1 DEFINE_PER_THREAD(long long, n_reads_pt); @@ -79,6 +95,12 @@ enum callrcu_type { CALLRCU_PERTHREAD, }; +enum writer_state { + WRITER_STATE_SYNC_RCU, + WRITER_STATE_CALL_RCU, + WRITER_STATE_POLL_RCU, +}; + static enum callrcu_type callrcu_type = CALLRCU_GLOBAL; long long n_reads = 0LL; @@ -139,10 +161,10 @@ void *rcu_read_perf_test(void *arg) run_on(me); uatomic_inc(&nthreadsrunning); put_thread_offline(); - while (goflag == GOFLAG_INIT) + while (uatomic_read(&goflag) == GOFLAG_INIT) (void) poll(NULL, 0, 1); put_thread_online(); - while (goflag == GOFLAG_RUN) { + while (uatomic_read(&goflag) == GOFLAG_RUN) { for (i = 0; i < RCU_READ_RUN; i++) { rcu_read_lock(); /* rcu_read_lock_nest(); */ @@ -174,9 +196,9 @@ void *rcu_update_perf_test(void *arg __attribute__((unused))) } } uatomic_inc(&nthreadsrunning); - while (goflag == GOFLAG_INIT) + while (uatomic_read(&goflag) == GOFLAG_INIT) (void) poll(NULL, 0, 1); - while (goflag == GOFLAG_RUN) { + while (uatomic_read(&goflag) == GOFLAG_RUN) { synchronize_rcu(); n_updates_local++; } @@ -205,15 +227,11 @@ int perftestrun(int nthreads, int nreaders, int nupdaters) int t; int duration = 1; - cmm_smp_mb(); while (uatomic_read(&nthreadsrunning) < nthreads) (void) poll(NULL, 0, 1); - goflag = GOFLAG_RUN; - cmm_smp_mb(); + uatomic_set(&goflag, GOFLAG_RUN); sleep(duration); - cmm_smp_mb(); - goflag = GOFLAG_STOP; - cmm_smp_mb(); + uatomic_set(&goflag, GOFLAG_STOP); wait_all_threads(); for_each_thread(t) { n_reads += per_thread(n_reads_pt, t); @@ -294,6 +312,13 @@ struct rcu_stress rcu_stress_array[RCU_STRESS_PIPE_LEN] = { { 0, 0 } }; struct rcu_stress *rcu_stress_current; int rcu_stress_idx = 0; +/* + * How many time a reader has seen something that should not be visible. It is + * an error if this value is different than zero at the end of the stress test. + * + * Here, the something that should not be visibile is an old pipe that has been + * freed (mbtest = 0). + */ int n_mberror = 0; DEFINE_PER_THREAD(long long [RCU_STRESS_PIPE_LEN + 1], rcu_stress_count); @@ -309,19 +334,25 @@ void *rcu_read_stress_test(void *arg __attribute__((unused))) rcu_register_thread(); put_thread_offline(); - while (goflag == GOFLAG_INIT) + while (uatomic_read(&goflag) == GOFLAG_INIT) (void) poll(NULL, 0, 1); put_thread_online(); - while (goflag == GOFLAG_RUN) { + while (uatomic_read(&goflag) == GOFLAG_RUN) { rcu_read_lock(); p = rcu_dereference(rcu_stress_current); if (p->mbtest == 0) - n_mberror++; + uatomic_inc_mo(&n_mberror, CMM_RELAXED); rcu_read_lock_nest(); + /* + * The value of garbage is nothing important. This is + * essentially a busy loop. The atomic operation -- while not + * important here -- helps tools such as TSAN to not flag this + * as a race condition. + */ for (i = 0; i < 100; i++) - garbage++; + uatomic_inc(&garbage); rcu_read_unlock_nest(); - pc = p->pipe_count; + pc = uatomic_read(&p->pipe_count); rcu_read_unlock(); if ((pc > RCU_STRESS_PIPE_LEN) || (pc < 0)) pc = RCU_STRESS_PIPE_LEN; @@ -340,34 +371,30 @@ void *rcu_read_stress_test(void *arg __attribute__((unused))) return (NULL); } -static pthread_mutex_t call_rcu_test_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t call_rcu_test_cond = PTHREAD_COND_INITIALIZER; +static DEFINE_URCU_WAIT_QUEUE(call_rcu_waiters); static void rcu_update_stress_test_rcu(struct rcu_head *head __attribute__((unused))) { - int ret; + struct urcu_waiters waiters; - ret = pthread_mutex_lock(&call_rcu_test_mutex); - if (ret) { - errno = ret; - diag("pthread_mutex_lock: %s", - strerror(errno)); - abort(); - } - ret = pthread_cond_signal(&call_rcu_test_cond); - if (ret) { - errno = ret; - diag("pthread_cond_signal: %s", - strerror(errno)); - abort(); - } - ret = pthread_mutex_unlock(&call_rcu_test_mutex); - if (ret) { - errno = ret; - diag("pthread_mutex_unlock: %s", - strerror(errno)); - abort(); + urcu_move_waiters(&waiters, &call_rcu_waiters); + urcu_wake_all_waiters(&waiters); +} + +static +void advance_writer_state(enum writer_state *state) +{ + switch (*state) { + case WRITER_STATE_SYNC_RCU: + *state = WRITER_STATE_CALL_RCU; + break; + case WRITER_STATE_CALL_RCU: + *state = WRITER_STATE_POLL_RCU; + break; + case WRITER_STATE_POLL_RCU: + *state = WRITER_STATE_SYNC_RCU; + break; } } @@ -375,73 +402,93 @@ static void *rcu_update_stress_test(void *arg __attribute__((unused))) { int i; - struct rcu_stress *p; + struct rcu_stress *p, *old_p; struct rcu_head rh; + enum writer_state writer_state = WRITER_STATE_SYNC_RCU; - while (goflag == GOFLAG_INIT) + rcu_register_thread(); + + /* Offline for poll. */ + put_thread_offline(); + while (uatomic_read(&goflag) == GOFLAG_INIT) (void) poll(NULL, 0, 1); - while (goflag == GOFLAG_RUN) { + put_thread_online(); + + old_p = NULL; + while (uatomic_read(&goflag) == GOFLAG_RUN) { i = rcu_stress_idx + 1; if (i >= RCU_STRESS_PIPE_LEN) i = 0; + + rcu_read_lock(); + old_p = rcu_dereference(rcu_stress_current); + rcu_read_unlock(); + + /* + * Allocate a new pipe. + */ p = &rcu_stress_array[i]; - p->mbtest = 0; - cmm_smp_mb(); p->pipe_count = 0; p->mbtest = 1; + rcu_assign_pointer(rcu_stress_current, p); rcu_stress_idx = i; + + /* + * Increment every pipe except the freshly allocated one. A + * reader should only see either the old pipe or the new + * pipe. This is reflected in the rcu_stress_count histogram. + */ for (i = 0; i < RCU_STRESS_PIPE_LEN; i++) if (i != rcu_stress_idx) - rcu_stress_array[i].pipe_count++; - if (n_updates & 0x1) + uatomic_inc(&rcu_stress_array[i].pipe_count); + + switch (writer_state) { + case WRITER_STATE_SYNC_RCU: synchronize_rcu(); - else { - int ret; - - ret = pthread_mutex_lock(&call_rcu_test_mutex); - if (ret) { - errno = ret; - diag("pthread_mutex_lock: %s", - strerror(errno)); - abort(); - } - rcu_register_thread(); + break; + case WRITER_STATE_CALL_RCU: + { + DEFINE_URCU_WAIT_NODE(wait, URCU_WAIT_WAITING); + + urcu_wait_add(&call_rcu_waiters, &wait); + call_rcu(&rh, rcu_update_stress_test_rcu); - rcu_unregister_thread(); - /* - * Our MacOS X test machine with the following - * config: - * 15.6.0 Darwin Kernel Version 15.6.0 - * root:xnu-3248.60.10~1/RELEASE_X86_64 - * appears to have issues with liburcu-signal - * signal being delivered on top of - * pthread_cond_wait. It seems to make the - * thread continue, and therefore corrupt the - * rcu_head. Work around this issue by - * unregistering the RCU read-side thread - * immediately after call_rcu (call_rcu needs - * us to be registered RCU readers). - */ - ret = pthread_cond_wait(&call_rcu_test_cond, - &call_rcu_test_mutex); - if (ret) { - errno = ret; - diag("pthread_cond_signal: %s", - strerror(errno)); - abort(); - } - ret = pthread_mutex_unlock(&call_rcu_test_mutex); - if (ret) { - errno = ret; - diag("pthread_mutex_unlock: %s", - strerror(errno)); - abort(); - } + + /* Offline for busy-wait. */ + put_thread_offline(); + urcu_adaptative_busy_wait(&wait); + put_thread_online(); + break; + } + case WRITER_STATE_POLL_RCU: + { + struct urcu_gp_poll_state poll_state; + + poll_state = start_poll_synchronize_rcu(); + + /* Offline for poll. */ + put_thread_offline(); + while (!poll_state_synchronize_rcu(poll_state)) + (void) poll(NULL, 0, 1); /* Wait for 1ms */ + put_thread_online(); + break; } + } + /* + * No readers should see that old pipe now. Setting mbtest to 0 + * to mark it as "freed". + */ + if (old_p) { + old_p->mbtest = 0; + } + old_p = p; n_updates++; + advance_writer_state(&writer_state); } + rcu_unregister_thread(); + return NULL; } @@ -457,9 +504,9 @@ void *rcu_fake_update_stress_test(void *arg __attribute__((unused))) set_thread_call_rcu_data(crdp); } } - while (goflag == GOFLAG_INIT) + while (uatomic_read(&goflag) == GOFLAG_INIT) (void) poll(NULL, 0, 1); - while (goflag == GOFLAG_RUN) { + while (uatomic_read(&goflag) == GOFLAG_RUN) { synchronize_rcu(); (void) poll(NULL, 0, 1); } @@ -480,6 +527,7 @@ int stresstest(int nreaders) int t; long long *p; long long sum; + int ret; init_per_thread(n_reads_pt, 0LL); for_each_thread(t) { @@ -495,13 +543,9 @@ int stresstest(int nreaders) create_thread(rcu_update_stress_test, NULL); for (i = 0; i < 5; i++) create_thread(rcu_fake_update_stress_test, NULL); - cmm_smp_mb(); - goflag = GOFLAG_RUN; - cmm_smp_mb(); + uatomic_set(&goflag, GOFLAG_RUN); sleep(10); - cmm_smp_mb(); - goflag = GOFLAG_STOP; - cmm_smp_mb(); + uatomic_set(&goflag, GOFLAG_STOP); wait_all_threads(); for_each_thread(t) n_reads += per_thread(n_reads_pt, t); @@ -509,11 +553,19 @@ int stresstest(int nreaders) n_reads, n_updates, n_mberror); rdiag_start(); rdiag("rcu_stress_count:"); + ret = 0; for (i = 0; i <= RCU_STRESS_PIPE_LEN; i++) { sum = 0LL; for_each_thread(t) { sum += per_thread(rcu_stress_count, t)[i]; } + /* + * If any entries past the first two are non-zero, RCU is + * broken. See details above about rcu_stress_count. + */ + if (i > 1 && sum != 0) { + ret = -1; + } rdiag(" %lld", sum); } rdiag_end(); @@ -521,10 +573,9 @@ int stresstest(int nreaders) diag("Deallocating per-CPU call_rcu threads."); free_all_cpu_call_rcu_data(); } - if (!n_mberror) - return 0; - else - return -1; + if (n_mberror) + ret = -1; + return ret; } /* @@ -532,7 +583,7 @@ int stresstest(int nreaders) */ static -void usage(char *argv[]) __attribute__((noreturn)); +void usage(char *argv[]) __attribute__((__noreturn__)); static void usage(char *argv[]) diff --git a/tests/regression/rcutorture_urcu_bp_perf_global.tap.in b/tests/regression/rcutorture_urcu_bp_perf_global.tap.in deleted file mode 100644 index 3dc7ff4..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_perf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_perf_global_cxx.tap.in deleted file mode 100644 index 434ce48..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_perf_percpu.tap.in b/tests/regression/rcutorture_urcu_bp_perf_percpu.tap.in deleted file mode 100644 index 5bbaa92..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_perf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_perf_percpu_cxx.tap.in deleted file mode 100644 index 3670707..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_perf_perthread.tap.in b/tests/regression/rcutorture_urcu_bp_perf_perthread.tap.in deleted file mode 100644 index d89ceb8..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_perf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_perf_perthread_cxx.tap.in deleted file mode 100644 index c7a21f6..0000000 --- a/tests/regression/rcutorture_urcu_bp_perf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_rperf_global.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_global.tap.in deleted file mode 100644 index f992f26..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_rperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_global_cxx.tap.in deleted file mode 100644 index 4f89e4d..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_rperf_percpu.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_percpu.tap.in deleted file mode 100644 index 8ac8212..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_rperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_percpu_cxx.tap.in deleted file mode 100644 index 3196964..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_rperf_perthread.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_perthread.tap.in deleted file mode 100644 index 69a7fbd..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_rperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_rperf_perthread_cxx.tap.in deleted file mode 100644 index edc6833..0000000 --- a/tests/regression/rcutorture_urcu_bp_rperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_stress_global.tap.in b/tests/regression/rcutorture_urcu_bp_stress_global.tap.in deleted file mode 100644 index 7c6ee1f..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_stress_global_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_stress_global_cxx.tap.in deleted file mode 100644 index f4ed990..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_stress_percpu.tap.in b/tests/regression/rcutorture_urcu_bp_stress_percpu.tap.in deleted file mode 100644 index a0b19c3..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_stress_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_stress_percpu_cxx.tap.in deleted file mode 100644 index cce2059..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_stress_perthread.tap.in b/tests/regression/rcutorture_urcu_bp_stress_perthread.tap.in deleted file mode 100644 index dbacd3f..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_stress_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_stress_perthread_cxx.tap.in deleted file mode 100644 index c3417ae..0000000 --- a/tests/regression/rcutorture_urcu_bp_stress_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_uperf_global.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_global.tap.in deleted file mode 100644 index b157d24..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_uperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_global_cxx.tap.in deleted file mode 100644 index be9f56f..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_bp_uperf_percpu.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_percpu.tap.in deleted file mode 100644 index 2c44eaa..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_uperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_percpu_cxx.tap.in deleted file mode 100644 index 6e5b261..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_bp_uperf_perthread.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_perthread.tap.in deleted file mode 100644 index 15e7d7d..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_bp_uperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_bp_uperf_perthread_cxx.tap.in deleted file mode 100644 index 0b9b5e6..0000000 --- a/tests/regression/rcutorture_urcu_bp_uperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_bp_cxx `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_perf_global.tap.in b/tests/regression/rcutorture_urcu_mb_perf_global.tap.in deleted file mode 100644 index 65603e7..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_perf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_perf_global_cxx.tap.in deleted file mode 100644 index 5f0c23f..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_perf_percpu.tap.in b/tests/regression/rcutorture_urcu_mb_perf_percpu.tap.in deleted file mode 100644 index 9b877c4..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_perf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_perf_percpu_cxx.tap.in deleted file mode 100644 index 2748401..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_perf_perthread.tap.in b/tests/regression/rcutorture_urcu_mb_perf_perthread.tap.in deleted file mode 100644 index 7da5afe..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_perf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_perf_perthread_cxx.tap.in deleted file mode 100644 index 2695d39..0000000 --- a/tests/regression/rcutorture_urcu_mb_perf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_rperf_global.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_global.tap.in deleted file mode 100644 index 1928d7d..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_rperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_global_cxx.tap.in deleted file mode 100644 index 21f6e7f..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_rperf_percpu.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_percpu.tap.in deleted file mode 100644 index ffa90fb..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_rperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_percpu_cxx.tap.in deleted file mode 100644 index d5e2f73..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_rperf_perthread.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_perthread.tap.in deleted file mode 100644 index 37be26e..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_rperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_rperf_perthread_cxx.tap.in deleted file mode 100644 index 72c8d22..0000000 --- a/tests/regression/rcutorture_urcu_mb_rperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_stress_global.tap.in b/tests/regression/rcutorture_urcu_mb_stress_global.tap.in deleted file mode 100644 index 6a1cdd9..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_stress_global_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_stress_global_cxx.tap.in deleted file mode 100644 index 5e089b2..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_stress_percpu.tap.in b/tests/regression/rcutorture_urcu_mb_stress_percpu.tap.in deleted file mode 100644 index d9994cd..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_stress_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_stress_percpu_cxx.tap.in deleted file mode 100644 index e542526..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_stress_perthread.tap.in b/tests/regression/rcutorture_urcu_mb_stress_perthread.tap.in deleted file mode 100644 index 1eb07a3..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_stress_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_stress_perthread_cxx.tap.in deleted file mode 100644 index 083550e..0000000 --- a/tests/regression/rcutorture_urcu_mb_stress_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_uperf_global.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_global.tap.in deleted file mode 100644 index 3d41a7c..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_uperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_global_cxx.tap.in deleted file mode 100644 index b4278ab..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_mb_uperf_percpu.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_percpu.tap.in deleted file mode 100644 index 30ec884..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_uperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_percpu_cxx.tap.in deleted file mode 100644 index 2b9ba17..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_mb_uperf_perthread.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_perthread.tap.in deleted file mode 100644 index de5c153..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_mb_uperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_mb_uperf_perthread_cxx.tap.in deleted file mode 100644 index 00c3e53..0000000 --- a/tests/regression/rcutorture_urcu_mb_uperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_mb_cxx `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_global.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_global.tap.in deleted file mode 100644 index a277d4e..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_global_cxx.tap.in deleted file mode 100644 index 77396c7..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_percpu.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_percpu.tap.in deleted file mode 100644 index 768a294..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_percpu_cxx.tap.in deleted file mode 100644 index 1085754..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_perthread.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_perthread.tap.in deleted file mode 100644 index a7baba4..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_perf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_perf_perthread_cxx.tap.in deleted file mode 100644 index 5369d8b..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_perf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_global.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_global.tap.in deleted file mode 100644 index 29000bb..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_global_cxx.tap.in deleted file mode 100644 index ea2b3dc..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_percpu.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_percpu.tap.in deleted file mode 100644 index 47c7351..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_percpu_cxx.tap.in deleted file mode 100644 index 7514490..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_perthread.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_perthread.tap.in deleted file mode 100644 index d947fd3..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_rperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_rperf_perthread_cxx.tap.in deleted file mode 100644 index e4ffe68..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_rperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_global.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_global.tap.in deleted file mode 100644 index f956efb..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_global_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_global_cxx.tap.in deleted file mode 100644 index 9ac4415..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_percpu.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_percpu.tap.in deleted file mode 100644 index 6cf1504..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_percpu_cxx.tap.in deleted file mode 100644 index afcfc14..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_perthread.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_perthread.tap.in deleted file mode 100644 index e6be1e6..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_stress_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_stress_perthread_cxx.tap.in deleted file mode 100644 index 0092a07..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_stress_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_global.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_global.tap.in deleted file mode 100644 index bd6d20e..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_global_cxx.tap.in deleted file mode 100644 index 0c675f1..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_percpu.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_percpu.tap.in deleted file mode 100644 index 54c3cbe..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_percpu_cxx.tap.in deleted file mode 100644 index ab6372b..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_perthread.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_perthread.tap.in deleted file mode 100644 index fb0dd5a..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_membarrier_uperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_membarrier_uperf_perthread_cxx.tap.in deleted file mode 100644 index b521187..0000000 --- a/tests/regression/rcutorture_urcu_membarrier_uperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_membarrier_cxx `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_global.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_global.tap.in deleted file mode 100644 index ddcac7a..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_global_cxx.tap.in deleted file mode 100644 index facb3c7..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_percpu.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_percpu.tap.in deleted file mode 100644 index 219646c..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_percpu_cxx.tap.in deleted file mode 100644 index 30cca48..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_perthread.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_perthread.tap.in deleted file mode 100644 index d063fe4..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_perf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_perf_perthread_cxx.tap.in deleted file mode 100644 index c461b6b..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_perf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_global.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_global.tap.in deleted file mode 100644 index ef2dbed..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_global_cxx.tap.in deleted file mode 100644 index 8c99091..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_percpu.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_percpu.tap.in deleted file mode 100644 index 4c5d8d5..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_percpu_cxx.tap.in deleted file mode 100644 index 6a91581..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_perthread.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_perthread.tap.in deleted file mode 100644 index badd161..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_rperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_rperf_perthread_cxx.tap.in deleted file mode 100644 index 6d0baeb..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_rperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_global.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_global.tap.in deleted file mode 100644 index e3d1c4c..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_global_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_global_cxx.tap.in deleted file mode 100644 index e68b690..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_percpu.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_percpu.tap.in deleted file mode 100644 index f3018fe..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_percpu_cxx.tap.in deleted file mode 100644 index f90fd19..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_perthread.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_perthread.tap.in deleted file mode 100644 index 451072e..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_stress_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_stress_perthread_cxx.tap.in deleted file mode 100644 index baaafb8..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_stress_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_global.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_global.tap.in deleted file mode 100644 index 1cdb803..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_global_cxx.tap.in deleted file mode 100644 index 4d89136..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_percpu.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_percpu.tap.in deleted file mode 100644 index ee2c1bd..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_percpu_cxx.tap.in deleted file mode 100644 index 70e5db0..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_perthread.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_perthread.tap.in deleted file mode 100644 index fbabf97..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_qsbr_uperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_qsbr_uperf_perthread_cxx.tap.in deleted file mode 100644 index c45d43a..0000000 --- a/tests/regression/rcutorture_urcu_qsbr_uperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_qsbr_cxx `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_perf_global.tap.in b/tests/regression/rcutorture_urcu_signal_perf_global.tap.in deleted file mode 100644 index 20f967f..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_perf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_perf_global_cxx.tap.in deleted file mode 100644 index 29778d1..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` perf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_perf_percpu.tap.in b/tests/regression/rcutorture_urcu_signal_perf_percpu.tap.in deleted file mode 100644 index 53ec18e..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_perf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_perf_percpu_cxx.tap.in deleted file mode 100644 index a2347e2..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` perf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_perf_perthread.tap.in b/tests/regression/rcutorture_urcu_signal_perf_perthread.tap.in deleted file mode 100644 index d8ca7ef..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_perf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_perf_perthread_cxx.tap.in deleted file mode 100644 index eafda3e..0000000 --- a/tests/regression/rcutorture_urcu_signal_perf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` perf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_rperf_global.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_global.tap.in deleted file mode 100644 index 2da3a93..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_rperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_global_cxx.tap.in deleted file mode 100644 index ac3c022..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` rperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_rperf_percpu.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_percpu.tap.in deleted file mode 100644 index 5497f2f..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_rperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_percpu_cxx.tap.in deleted file mode 100644 index c18c2ff..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` rperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_rperf_perthread.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_perthread.tap.in deleted file mode 100644 index 6c62c15..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_rperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_rperf_perthread_cxx.tap.in deleted file mode 100644 index 273f219..0000000 --- a/tests/regression/rcutorture_urcu_signal_rperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` rperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_stress_global.tap.in b/tests/regression/rcutorture_urcu_signal_stress_global.tap.in deleted file mode 100644 index c667dbf..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_stress_global_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_stress_global_cxx.tap.in deleted file mode 100644 index de8e4f6..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` stress 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_stress_percpu.tap.in b/tests/regression/rcutorture_urcu_signal_stress_percpu.tap.in deleted file mode 100644 index 429b731..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_stress_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_stress_percpu_cxx.tap.in deleted file mode 100644 index 032117c..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` stress 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_stress_perthread.tap.in b/tests/regression/rcutorture_urcu_signal_stress_perthread.tap.in deleted file mode 100644 index 62d190d..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_stress_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_stress_perthread_cxx.tap.in deleted file mode 100644 index e8227f3..0000000 --- a/tests/regression/rcutorture_urcu_signal_stress_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` stress 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_uperf_global.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_global.tap.in deleted file mode 100644 index e86b6d7..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_global.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_uperf_global_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_global_cxx.tap.in deleted file mode 100644 index c6c096f..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_global_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` uperf 1 callrcu_global diff --git a/tests/regression/rcutorture_urcu_signal_uperf_percpu.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_percpu.tap.in deleted file mode 100644 index c212711..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_percpu.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_uperf_percpu_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_percpu_cxx.tap.in deleted file mode 100644 index d50ec28..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_percpu_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` uperf 1 callrcu_percpu diff --git a/tests/regression/rcutorture_urcu_signal_uperf_perthread.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_perthread.tap.in deleted file mode 100644 index 1d92879..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_perthread.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/rcutorture_urcu_signal_uperf_perthread_cxx.tap.in b/tests/regression/rcutorture_urcu_signal_uperf_perthread_cxx.tap.in deleted file mode 100644 index 570a0d8..0000000 --- a/tests/regression/rcutorture_urcu_signal_uperf_perthread_cxx.tap.in +++ /dev/null @@ -1 +0,0 @@ -./rcutorture_urcu_signal_cxx `@NPROC_CMD@` uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_global.tap b/tests/regression/test_rcutorture_urcu_bp_perf_global.tap new file mode 100755 index 0000000..96a640d --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_perf_global_cxx.tap new file mode 100755 index 0000000..9c324bd --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_percpu.tap b/tests/regression/test_rcutorture_urcu_bp_perf_percpu.tap new file mode 100755 index 0000000..f697116 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_perf_percpu_cxx.tap new file mode 100755 index 0000000..e30d6f5 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_perthread.tap b/tests/regression/test_rcutorture_urcu_bp_perf_perthread.tap new file mode 100755 index 0000000..f18dc8c --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_perf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_perf_perthread_cxx.tap new file mode 100755 index 0000000..54c09ec --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_perf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_global.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_global.tap new file mode 100755 index 0000000..c003127 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_global_cxx.tap new file mode 100755 index 0000000..4109798 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_percpu.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_percpu.tap new file mode 100755 index 0000000..96d3674 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_percpu_cxx.tap new file mode 100755 index 0000000..9ce9e9f --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_perthread.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_perthread.tap new file mode 100755 index 0000000..9635caa --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_rperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_rperf_perthread_cxx.tap new file mode 100755 index 0000000..66668fe --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_rperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_global.tap b/tests/regression/test_rcutorture_urcu_bp_stress_global.tap new file mode 100755 index 0000000..1fad3ac --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_global_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_stress_global_cxx.tap new file mode 100755 index 0000000..f807630 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_percpu.tap b/tests/regression/test_rcutorture_urcu_bp_stress_percpu.tap new file mode 100755 index 0000000..b4daa59 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_stress_percpu_cxx.tap new file mode 100755 index 0000000..84d0a4a --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_perthread.tap b/tests/regression/test_rcutorture_urcu_bp_stress_perthread.tap new file mode 100755 index 0000000..440327b --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_stress_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_stress_perthread_cxx.tap new file mode 100755 index 0000000..05df988 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_stress_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_global.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_global.tap new file mode 100755 index 0000000..fa908a9 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_global_cxx.tap new file mode 100755 index 0000000..550049f --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_percpu.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_percpu.tap new file mode 100755 index 0000000..0a84e68 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_percpu_cxx.tap new file mode 100755 index 0000000..2231c00 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_perthread.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_perthread.tap new file mode 100755 index 0000000..a33820f --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_bp_uperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_bp_uperf_perthread_cxx.tap new file mode 100755 index 0000000..3ef20d9 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_bp_uperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_bp_cxx" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_global.tap b/tests/regression/test_rcutorture_urcu_mb_perf_global.tap new file mode 100755 index 0000000..f0f3370 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_perf_global_cxx.tap new file mode 100755 index 0000000..416dc31 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_percpu.tap b/tests/regression/test_rcutorture_urcu_mb_perf_percpu.tap new file mode 100755 index 0000000..6a6c0ee --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_perf_percpu_cxx.tap new file mode 100755 index 0000000..ffb2e93 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_perthread.tap b/tests/regression/test_rcutorture_urcu_mb_perf_perthread.tap new file mode 100755 index 0000000..898629e --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_perf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_perf_perthread_cxx.tap new file mode 100755 index 0000000..718da74 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_perf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_global.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_global.tap new file mode 100755 index 0000000..61543ea --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_global_cxx.tap new file mode 100755 index 0000000..379ae65 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_percpu.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_percpu.tap new file mode 100755 index 0000000..5fdca8a --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_percpu_cxx.tap new file mode 100755 index 0000000..c153c78 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_perthread.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_perthread.tap new file mode 100755 index 0000000..254d171 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_rperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_rperf_perthread_cxx.tap new file mode 100755 index 0000000..0f1cb64 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_rperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_global.tap b/tests/regression/test_rcutorture_urcu_mb_stress_global.tap new file mode 100755 index 0000000..a07fcec --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_global_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_stress_global_cxx.tap new file mode 100755 index 0000000..a896058 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_percpu.tap b/tests/regression/test_rcutorture_urcu_mb_stress_percpu.tap new file mode 100755 index 0000000..bf1f9d1 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_stress_percpu_cxx.tap new file mode 100755 index 0000000..67135dc --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_perthread.tap b/tests/regression/test_rcutorture_urcu_mb_stress_perthread.tap new file mode 100755 index 0000000..73a6f04 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_stress_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_stress_perthread_cxx.tap new file mode 100755 index 0000000..520960d --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_stress_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_global.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_global.tap new file mode 100755 index 0000000..2455a48 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_global_cxx.tap new file mode 100755 index 0000000..dbbca53 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_percpu.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_percpu.tap new file mode 100755 index 0000000..36bc4b0 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_percpu_cxx.tap new file mode 100755 index 0000000..7115576 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_perthread.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_perthread.tap new file mode 100755 index 0000000..d6628bf --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_mb_uperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_mb_uperf_perthread_cxx.tap new file mode 100755 index 0000000..759a068 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_mb_uperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_mb_cxx" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_global.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_global.tap new file mode 100755 index 0000000..05f22ac --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_global_cxx.tap new file mode 100755 index 0000000..f88e08b --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu.tap new file mode 100755 index 0000000..7c4cc53 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu_cxx.tap new file mode 100755 index 0000000..f24a04b --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread.tap new file mode 100755 index 0000000..2b5c1b8 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread_cxx.tap new file mode 100755 index 0000000..c40de4c --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_perf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_global.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_global.tap new file mode 100755 index 0000000..edea741 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_global_cxx.tap new file mode 100755 index 0000000..5b48589 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu.tap new file mode 100755 index 0000000..dd585cf --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu_cxx.tap new file mode 100755 index 0000000..864fa63 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread.tap new file mode 100755 index 0000000..9875d1e --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread_cxx.tap new file mode 100755 index 0000000..3d60e0f --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_rperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_global.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_global.tap new file mode 100755 index 0000000..4642ce4 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_global_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_global_cxx.tap new file mode 100755 index 0000000..0cc7783 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu.tap new file mode 100755 index 0000000..3f9efbf --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu_cxx.tap new file mode 100755 index 0000000..f5d1c3f --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread.tap new file mode 100755 index 0000000..1b239a5 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread_cxx.tap new file mode 100755 index 0000000..a7c5daa --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_stress_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_global.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_global.tap new file mode 100755 index 0000000..f738f24 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_global_cxx.tap new file mode 100755 index 0000000..0b18350 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu.tap new file mode 100755 index 0000000..d1d24ea --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu_cxx.tap new file mode 100755 index 0000000..a85bd48 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread.tap new file mode 100755 index 0000000..dd19f6c --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread_cxx.tap new file mode 100755 index 0000000..7d79de1 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_membarrier_uperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_membarrier_cxx" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_global.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_global.tap new file mode 100755 index 0000000..0b75a48 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_global_cxx.tap new file mode 100755 index 0000000..eba1e88 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" perf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu.tap new file mode 100755 index 0000000..8d7c804 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu_cxx.tap new file mode 100755 index 0000000..21e6e63 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" perf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread.tap new file mode 100755 index 0000000..7058cec --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread_cxx.tap new file mode 100755 index 0000000..93069f6 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_perf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" perf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_global.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_global.tap new file mode 100755 index 0000000..3b0c68d --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_global_cxx.tap new file mode 100755 index 0000000..d6cf3ff --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" rperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu.tap new file mode 100755 index 0000000..df0bbc8 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu_cxx.tap new file mode 100755 index 0000000..d722551 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" rperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread.tap new file mode 100755 index 0000000..5fc6d3d --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread_cxx.tap new file mode 100755 index 0000000..35563ea --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_rperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" rperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_global.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_global.tap new file mode 100755 index 0000000..b7140ab --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_global_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_global_cxx.tap new file mode 100755 index 0000000..cd45337 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" stress 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu.tap new file mode 100755 index 0000000..38f3836 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu_cxx.tap new file mode 100755 index 0000000..ee9e944 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" stress 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread.tap new file mode 100755 index 0000000..696192d --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread_cxx.tap new file mode 100755 index 0000000..4e79a37 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_stress_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" stress 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_global.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_global.tap new file mode 100755 index 0000000..ef8dce8 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_global.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_global_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_global_cxx.tap new file mode 100755 index 0000000..678a9ff --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_global_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" uperf 1 callrcu_global diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu.tap new file mode 100755 index 0000000..c360c75 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu_cxx.tap new file mode 100755 index 0000000..24addb9 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_percpu_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" uperf 1 callrcu_percpu diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread.tap new file mode 100755 index 0000000..0fd439a --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread_cxx.tap b/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread_cxx.tap new file mode 100755 index 0000000..e64df13 --- /dev/null +++ b/tests/regression/test_rcutorture_urcu_qsbr_uperf_perthread_cxx.tap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + + +"${URCU_TESTS_BUILDDIR}/regression/rcutorture_urcu_qsbr_cxx" "$(urcu_nproc)" uperf 1 callrcu_perthread diff --git a/tests/regression/test_urcu_fork.c b/tests/regression/test_urcu_fork.c index db4e81d..52ccce7 100644 --- a/tests/regression/test_urcu_fork.c +++ b/tests/regression/test_urcu_fork.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_fork.c - * * Userspace RCU library - test program (fork) - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/regression/test_urcu_fork_cxx.cpp b/tests/regression/test_urcu_fork_cxx.cpp index 8c87220..2f65b46 100644 --- a/tests/regression/test_urcu_fork_cxx.cpp +++ b/tests/regression/test_urcu_fork_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_fork.c" diff --git a/tests/regression/urcutorture.c b/tests/regression/urcutorture.c index 5e9b059..ed256ea 100644 --- a/tests/regression/urcutorture.c +++ b/tests/regression/urcutorture.c @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + #include #include #include @@ -11,9 +15,6 @@ #ifdef RCU_MEMBARRIER #include #endif -#ifdef RCU_SIGNAL -#include -#endif #ifdef RCU_MB #include #endif diff --git a/tests/regression/urcutorture_cxx.cpp b/tests/regression/urcutorture_cxx.cpp index ab4e582..cacd0bf 100644 --- a/tests/regression/urcutorture_cxx.cpp +++ b/tests/regression/urcutorture_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "urcutorture.c" diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index e68fefe..5884ccb 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -1,12 +1,26 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common LOG_DRIVER_FLAGS = --merge --comments -LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ - $(top_srcdir)/tests/utils/tap-driver.sh +LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \ + URCU_TESTS_SRCDIR='$(abs_top_srcdir)/tests' \ + URCU_TESTS_BUILDDIR='$(abs_top_builddir)/tests' \ + $(SHELL) $(top_srcdir)/tests/utils/tap-driver.sh noinst_PROGRAMS = \ + get_cpu_mask_from_sysfs \ + get_cpu_mask_from_sysfs_cxx \ + get_max_cpuid_from_sysfs \ + get_max_cpuid_from_sysfs_cxx \ test_arch \ test_arch_cxx \ + test_get_max_cpuid_from_mask \ + test_get_max_cpuid_from_mask_cxx \ + test_get_possible_cpus_array_len \ + test_get_possible_cpus_array_len_cxx \ test_uatomic \ test_uatomic_cxx \ test_urcu_multiflavor \ @@ -22,7 +36,37 @@ noinst_PROGRAMS = \ test_build_dynlink \ test_build_dynlink_cxx -TESTS = $(noinst_PROGRAMS) +dist_noinst_SCRIPTS = \ + test_get_cpu_mask_from_sysfs \ + test_get_cpu_mask_from_sysfs_cxx \ + test_get_max_cpuid_from_sysfs \ + test_get_max_cpuid_from_sysfs_cxx + +TESTS = \ + test_arch \ + test_arch_cxx \ + test_get_cpu_mask_from_sysfs \ + test_get_cpu_mask_from_sysfs_cxx \ + test_get_max_cpuid_from_mask \ + test_get_max_cpuid_from_mask_cxx \ + test_get_max_cpuid_from_sysfs \ + test_get_max_cpuid_from_sysfs_cxx \ + test_get_possible_cpus_array_len \ + test_get_possible_cpus_array_len_cxx \ + test_uatomic \ + test_uatomic_cxx \ + test_urcu_multiflavor \ + test_urcu_multiflavor_cxx \ + test_urcu_multiflavor_dynlink \ + test_urcu_multiflavor_dynlink_cxx \ + test_urcu_multiflavor_single_unit \ + test_urcu_multiflavor_single_unit_cxx \ + test_urcu_multiflavor_single_unit_dynlink \ + test_urcu_multiflavor_single_unit_dynlink_cxx \ + test_build \ + test_build_cxx \ + test_build_dynlink \ + test_build_dynlink_cxx noinst_HEADERS = test_urcu_multiflavor.h @@ -30,17 +74,33 @@ URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la URCU_LIB=$(top_builddir)/src/liburcu.la URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la TAP_LIB=$(top_builddir)/tests/utils/libtap.a +get_cpu_mask_from_sysfs_cxx_SOURCES = get_cpu_mask_from_sysfs_cxx.cpp +get_cpu_mask_from_sysfs_SOURCES = get_cpu_mask_from_sysfs.c +get_max_cpuid_from_sysfs_cxx_SOURCES = get_max_cpuid_from_sysfs_cxx.cpp +get_max_cpuid_from_sysfs_SOURCES = get_max_cpuid_from_sysfs.c + test_arch_SOURCES = test_arch.c test_arch_LDADD = $(URCU_COMMON_LIB) $(TAP_LIB) test_arch_cxx_SOURCES = test_arch_cxx.cpp test_arch_cxx_LDADD = $(URCU_COMMO_LIB) $(TAP_LIB) +test_get_max_cpuid_from_mask_SOURCES = test_get_max_cpuid_from_mask.c +test_get_max_cpuid_from_mask_LDADD = $(TAP_LIB) + +test_get_max_cpuid_from_mask_cxx_SOURCES = test_get_max_cpuid_from_mask_cxx.cpp +test_get_max_cpuid_from_mask_cxx_LDADD = $(TAP_LIB) + +test_get_possible_cpus_array_len_SOURCES = test_get_possible_cpus_array_len.c +test_get_possible_cpus_array_len_LDADD = $(TAP_LIB) + +test_get_possible_cpus_array_len_cxx_SOURCES = test_get_possible_cpus_array_len_cxx.cpp +test_get_possible_cpus_array_len_cxx_LDADD = $(TAP_LIB) + test_uatomic_SOURCES = test_uatomic.c test_uatomic_LDADD = $(URCU_COMMON_LIB) $(TAP_LIB) @@ -50,58 +110,54 @@ test_uatomic_cxx_LDADD = $(URCU_COMMON_LIB) $(TAP_LIB) test_urcu_multiflavor_SOURCES = test_urcu_multiflavor.c \ test_urcu_multiflavor-memb.c \ test_urcu_multiflavor-mb.c \ - test_urcu_multiflavor-signal.c \ test_urcu_multiflavor-qsbr.c \ test_urcu_multiflavor-bp.c test_urcu_multiflavor_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_cxx_SOURCES = test_urcu_multiflavor_cxx.cpp \ test_urcu_multiflavor-memb_cxx.cpp \ test_urcu_multiflavor-mb_cxx.cpp \ - test_urcu_multiflavor-signal_cxx.cpp \ test_urcu_multiflavor-qsbr_cxx.cpp \ test_urcu_multiflavor-bp_cxx.cpp test_urcu_multiflavor_cxx_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_dynlink_SOURCES = test_urcu_multiflavor.c \ test_urcu_multiflavor-memb.c \ test_urcu_multiflavor-mb.c \ - test_urcu_multiflavor-signal.c \ test_urcu_multiflavor-qsbr.c \ test_urcu_multiflavor-bp.c test_urcu_multiflavor_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_multiflavor_dynlink_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_dynlink_cxx_SOURCES = test_urcu_multiflavor_cxx.cpp \ test_urcu_multiflavor-memb_cxx.cpp \ test_urcu_multiflavor-mb_cxx.cpp \ - test_urcu_multiflavor-signal_cxx.cpp \ test_urcu_multiflavor-qsbr_cxx.cpp \ test_urcu_multiflavor-bp_cxx.cpp test_urcu_multiflavor_dynlink_cxx_CXXFLAGS = -DDYNAMIC_LINK_TEST $(AM_CXXFLAGS) test_urcu_multiflavor_dynlink_cxx_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_single_unit_SOURCES = test_urcu_multiflavor_single_unit.c test_urcu_multiflavor_single_unit_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_single_unit_cxx_SOURCES = test_urcu_multiflavor_single_unit_cxx.cpp test_urcu_multiflavor_single_unit_cxx_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_single_unit_dynlink_SOURCES = test_urcu_multiflavor_single_unit.c test_urcu_multiflavor_single_unit_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) test_urcu_multiflavor_single_unit_dynlink_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_urcu_multiflavor_single_unit_dynlink_cxx_SOURCES = test_urcu_multiflavor_single_unit_cxx.cpp test_urcu_multiflavor_single_unit_dynlink_cxx_CXXFLAGS = -DDYNAMIC_LINK_TEST $(AM_CXXFLAGS) test_urcu_multiflavor_single_unit_dynlink_cxx_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \ - $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) + $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB) test_build_SOURCES = \ test_build.c @@ -114,24 +170,9 @@ test_build_cxx_LDADD = $(URCU_COMMON_LIB) $(URCU_CDS_LIB) $(TAP_LIB) test_build_dynlink_SOURCES = \ test_build.c test_build_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -test_build_dynlink_LDADD = $(URCU_COMMON_LIB) $(URCU_CDS_LIB) $(TAP_LIB) +test_build_dynlink_LDADD = $(URCU_LIB) $(URCU_COMMON_LIB) $(URCU_CDS_LIB) $(TAP_LIB) test_build_dynlink_cxx_SOURCES = \ test_build_cxx.cpp test_build_dynlink_cxx_CXXFLAGS = -DDYNAMIC_LINK_TEST $(AM_CXXFLAGS) -test_build_dynlink_cxx_LDADD = $(URCU_COMMON_LIB) $(URCU_CDS_LIB) $(TAP_LIB) - -all-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - cp -f $(srcdir)/$$script $(builddir); \ - done; \ - fi - -clean-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - rm -f $(builddir)/$$script; \ - done; \ - fi - +test_build_dynlink_cxx_LDADD = $(URCU_LIB) $(URCU_COMMON_LIB) $(URCU_CDS_LIB) $(TAP_LIB) diff --git a/tests/unit/get_cpu_mask_from_sysfs.c b/tests/unit/get_cpu_mask_from_sysfs.c new file mode 100644 index 0000000..7938f23 --- /dev/null +++ b/tests/unit/get_cpu_mask_from_sysfs.c @@ -0,0 +1,40 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include +#include + +#ifdef __linux__ + +#include "compat-smp.h" + +int main(int argc, char *argv[]) +{ + int ret; + char buf[URCU_CPUMASK_SIZE]; + + if( argc < 2 ) { + fprintf(stderr, "Missing argument.\n"); + return EXIT_FAILURE; + } + + ret = get_cpu_mask_from_sysfs((char *) &buf, URCU_CPUMASK_SIZE, argv[1]); + + printf("%s", buf); + + if (ret >= 0) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +} + +#else + +int main(void) +{ + return EXIT_SUCCESS; +} +#endif diff --git a/tests/unit/get_cpu_mask_from_sysfs_cxx.cpp b/tests/unit/get_cpu_mask_from_sysfs_cxx.cpp new file mode 100644 index 0000000..a413f3c --- /dev/null +++ b/tests/unit/get_cpu_mask_from_sysfs_cxx.cpp @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "get_cpu_mask_from_sysfs.c" diff --git a/tests/unit/get_max_cpuid_from_sysfs.c b/tests/unit/get_max_cpuid_from_sysfs.c new file mode 100644 index 0000000..37c4b3d --- /dev/null +++ b/tests/unit/get_max_cpuid_from_sysfs.c @@ -0,0 +1,39 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include +#include + +#ifdef __linux__ + +#include "compat-smp.h" + +int main(int argc, char *argv[]) +{ + int ret; + + if( argc < 2 ) { + fprintf(stderr, "Missing argument.\n"); + return EXIT_FAILURE; + } + + ret = _get_max_cpuid_from_sysfs(argv[1]); + + printf("%d\n", ret); + + if (ret >= 0) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +} + +#else + +int main(void) +{ + return EXIT_SUCCESS; +} +#endif diff --git a/tests/unit/get_max_cpuid_from_sysfs_cxx.cpp b/tests/unit/get_max_cpuid_from_sysfs_cxx.cpp new file mode 100644 index 0000000..4e46dfb --- /dev/null +++ b/tests/unit/get_max_cpuid_from_sysfs_cxx.cpp @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "get_max_cpuid_from_sysfs.c" diff --git a/tests/unit/test_arch.c b/tests/unit/test_arch.c index fb447d6..141c564 100644 --- a/tests/unit/test_arch.c +++ b/tests/unit/test_arch.c @@ -1,24 +1,6 @@ -/* - * test_arch.c - * - * Userspace RCU library - test arch headers - * - * Copyright February 2021 Michael Jeanson - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ +// SPDX-FileCopyrightText: 2021 Michael Jeanson +// +// SPDX-License-Identifier: GPL-2.0-or-later #include #include diff --git a/tests/unit/test_arch_cxx.cpp b/tests/unit/test_arch_cxx.cpp index 5aa9d98..6c6c972 100644 --- a/tests/unit/test_arch_cxx.cpp +++ b/tests/unit/test_arch_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_arch.c" diff --git a/tests/unit/test_build.c b/tests/unit/test_build.c index b2786c5..99ddbcd 100644 --- a/tests/unit/test_build.c +++ b/tests/unit/test_build.c @@ -1,20 +1,6 @@ -/* - * Copyright 2021 Simon Marchi - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ +// SPDX-FileCopyrightText: 2021 Simon Marchi +// +// SPDX-License-Identifier: GPL-2.0-or-later /* * This file is meant to verify that headers are compatible with both C and @@ -52,13 +38,21 @@ #include #include #include -#include #include #include #include #include "tap.h" +struct my_tls_struct { + int int1; + char char1; + void *void1; +}; + +static DEFINE_URCU_TLS(int, my_tls_int); +static DEFINE_URCU_TLS(struct my_tls_struct, my_tls_struct); + static void test_lfstack(void) { struct cds_lfs_stack s; @@ -97,6 +91,35 @@ void test_build_cds_list_head_init(void) }; } +static +void test_urcu_tls(void) +{ + URCU_TLS(my_tls_int) = 1; + URCU_TLS(my_tls_struct).int1 = 1; + URCU_TLS(my_tls_struct).char1 = 'a'; + URCU_TLS(my_tls_struct).void1 = NULL; +} + +struct an_opaque_struct; +struct a_clear_struct +{ + int x; +}; + +static +void test_build_rcu_dereference(void) +{ + static struct an_opaque_struct *opaque = NULL; + static struct an_opaque_struct *const opaque_const = NULL; + static struct a_clear_struct *clear = NULL; + static struct a_clear_struct *const clear_const = NULL; + + (void) rcu_dereference(opaque); + (void) rcu_dereference(opaque_const); + (void) rcu_dereference(clear); + (void) rcu_dereference(clear_const); +} + int main(void) { plan_tests(3); @@ -105,6 +128,8 @@ int main(void) test_wfstack(); test_wfcqueue(); test_build_cds_list_head_init(); + test_urcu_tls(); + test_build_rcu_dereference(); return exit_status(); } diff --git a/tests/unit/test_build_cxx.cpp b/tests/unit/test_build_cxx.cpp index 5a45b6a..0d557e5 100644 --- a/tests/unit/test_build_cxx.cpp +++ b/tests/unit/test_build_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_build.c" diff --git a/tests/unit/test_get_cpu_mask_from_sysfs b/tests/unit/test_get_cpu_mask_from_sysfs new file mode 100755 index 0000000..0709892 --- /dev/null +++ b/tests/unit/test_get_cpu_mask_from_sysfs @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + +# shellcheck source=../../utils/tap.sh +source "$URCU_TESTS_SRCDIR/utils/tap.sh" + +CURDIR="${URCU_TESTS_BUILDDIR}/unit" + +NUM_TESTS=8 + +TESTFILE=$(mktemp) + +populate_testfile() { + local cpumask="$1" + + # shellcheck disable=SC2059 + printf "$cpumask" > "$TESTFILE" +} + +test_test_get_cpu_mask_from_sysfs() { + local cpumask="$1" + local result + + # Without '\n' + populate_testfile "$cpumask" + result=$("${CURDIR}/get_cpu_mask_from_sysfs" "$TESTFILE") + test "$cpumask" == "$result" + ok $? "test_get_cpu_mask_from_sysfs - without '\n' expected: '$cpumask', result: '$result'" + + # With '\n' + populate_testfile "$cpumask\n" + result=$("${CURDIR}/get_cpu_mask_from_sysfs" "$TESTFILE") + test "$cpumask" == "$result" + ok $? "test_get_cpu_mask_from_sysfs - with '\n' expected: '$cpumask', result: '$result'" +} + +if [ "$URCU_TESTS_OS_TYPE" == "linux" ]; then + plan_tests $NUM_TESTS + + test_test_get_cpu_mask_from_sysfs "" + test_test_get_cpu_mask_from_sysfs "0" + test_test_get_cpu_mask_from_sysfs "0-3" + test_test_get_cpu_mask_from_sysfs "0,3-7,9" +else + plan_skip_all "Linux specific tests." +fi diff --git a/tests/unit/test_get_cpu_mask_from_sysfs_cxx b/tests/unit/test_get_cpu_mask_from_sysfs_cxx new file mode 100755 index 0000000..4ed4ebd --- /dev/null +++ b/tests/unit/test_get_cpu_mask_from_sysfs_cxx @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + +# shellcheck source=../../utils/tap.sh +source "$URCU_TESTS_SRCDIR/utils/tap.sh" + +CURDIR="${URCU_TESTS_BUILDDIR}/unit" + +NUM_TESTS=8 + +TESTFILE=$(mktemp) + +populate_testfile() { + local cpumask="$1" + + # shellcheck disable=SC2059 + printf "$cpumask" > "$TESTFILE" +} + +test_test_get_cpu_mask_from_sysfs_cxx() { + local cpumask="$1" + local result + + # Without '\n' + populate_testfile "$cpumask" + result=$("${CURDIR}/get_cpu_mask_from_sysfs_cxx" "$TESTFILE") + test "$cpumask" == "$result" + ok $? "test_get_cpu_mask_from_sysfs_cxx - without '\n' expected: '$cpumask', result: '$result'" + + # With '\n' + populate_testfile "$cpumask\n" + result=$("${CURDIR}/get_cpu_mask_from_sysfs_cxx" "$TESTFILE") + test "$cpumask" == "$result" + ok $? "test_get_cpu_mask_from_sysfs_cxx - with '\n' expected: '$cpumask', result: '$result'" +} + +if [ "$URCU_TESTS_OS_TYPE" == "linux" ]; then + plan_tests $NUM_TESTS + + test_test_get_cpu_mask_from_sysfs_cxx "" + test_test_get_cpu_mask_from_sysfs_cxx "0" + test_test_get_cpu_mask_from_sysfs_cxx "0-3" + test_test_get_cpu_mask_from_sysfs_cxx "0,3-7,9" +else + plan_skip_all "Linux specific tests." +fi diff --git a/tests/unit/test_get_max_cpuid_from_mask.c b/tests/unit/test_get_max_cpuid_from_mask.c new file mode 100644 index 0000000..25a2417 --- /dev/null +++ b/tests/unit/test_get_max_cpuid_from_mask.c @@ -0,0 +1,88 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include + +#include "tap.h" + +#include "compat-smp.h" + +#ifdef __linux__ +struct parse_test_data { + const char *buf; + int expected; +}; + +static struct parse_test_data parse_test_data[] = { + { "", -1 }, + { "abc", -1 }, + { ",,,", -1 }, + { "--", -1 }, + { ",", -1 }, + { "-", -1 }, + { "2147483647", -1 }, + { "18446744073709551615", -1 }, + { "0-2147483647", -1 }, + { "0-18446744073709551615", -1 }, + { "0", 0 }, + { "1", 1 }, + { "0-1", 1 }, + { "1-3", 3 }, + { "0,2", 2 }, + { "1,2", 2 }, + { "0,4-6,127", 127 }, + { "0-4095", 4095 }, + + { "\n", -1 }, + { "abc\n", -1 }, + { ",,,\n", -1 }, + { "--\n", -1 }, + { ",\n", -1 }, + { "-\n", -1 }, + { "2147483647\n", -1 }, + { "18446744073709551615\n", -1 }, + { "0-2147483647\n", -1 }, + { "0-18446744073709551615\n", -1 }, + { "0\n", 0 }, + { "1\n", 1 }, + { "0-1\n", 1 }, + { "1-3\n", 3 }, + { "0,2\n", 2 }, + { "1,2\n", 2 }, + { "0,4-6,127\n", 127 }, + { "0-4095\n", 4095 }, +}; + +static int parse_test_data_len = sizeof(parse_test_data) / sizeof(parse_test_data[0]); + +int main(void) +{ + int ret, i; + + plan_tests(parse_test_data_len); + + diag("Testing smp helpers"); + + for (i = 0; i < parse_test_data_len; i++) { + ret = get_max_cpuid_from_mask(parse_test_data[i].buf, + strlen(parse_test_data[i].buf)); + ok(ret == parse_test_data[i].expected, + "get_max_cpuid_from_mask '%s', expected: '%d', result: '%d'", + parse_test_data[i].buf, parse_test_data[i].expected, ret); + } + + return exit_status(); +} + +#else + +int main(void) +{ + plan_skip_all("Linux specific tests."); + + return exit_status(); +} +#endif diff --git a/tests/unit/test_get_max_cpuid_from_mask_cxx.cpp b/tests/unit/test_get_max_cpuid_from_mask_cxx.cpp new file mode 100644 index 0000000..bd91459 --- /dev/null +++ b/tests/unit/test_get_max_cpuid_from_mask_cxx.cpp @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "test_get_max_cpuid_from_mask.c" diff --git a/tests/unit/test_get_max_cpuid_from_sysfs b/tests/unit/test_get_max_cpuid_from_sysfs new file mode 100755 index 0000000..7c0abce --- /dev/null +++ b/tests/unit/test_get_max_cpuid_from_sysfs @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + +# shellcheck source=../../utils/tap.sh +source "$URCU_TESTS_SRCDIR/utils/tap.sh" + +CURDIR="${URCU_TESTS_BUILDDIR}/unit" + +STD_OUTPUT="/dev/null" +STD_ERROR="/dev/null" + +NUM_TESTS=13 + +TESTDIR=$(mktemp -d) + +populate_testdir() { + local cpus=("$@") + + mkdir "$TESTDIR" + + for i in "${cpus[@]}"; do + mkdir "$TESTDIR/$i" + done +} + +test_get_max_cpuid_from_sysfs() { + local num_cpus=$1 + shift + local current_cpus=("$@") + local result + + populate_testdir "${current_cpus[@]}" >"$STD_OUTPUT" 2>"$STD_ERROR" + result=$("${CURDIR}/get_max_cpuid_from_sysfs" "$TESTDIR") + is "$result" "$num_cpus" "get_max_cpuid_from_sysfs - cpu set: '${current_cpus[*]}', expected: '$num_cpus', result: '$result'" + rm -rf "$TESTDIR" +} + +if [ "$URCU_TESTS_OS_TYPE" == "linux" ]; then + plan_tests $NUM_TESTS + + diag "get_max_cpuid_from_sysfs" + + test_data=(0 "cpu0") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(1 "cpu0" "cpu1") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(1 "cpu1" "cpu0") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(3 "cpu3") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(99 "cpu99") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(3 "cpu0" "cpu3") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(3 "cpufreq" "cpuidle" "cpu0" "cpu1" "cpu2" "cpu3") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(0 "cpu" "cpu0") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(5 "cpu" "cpu5") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + + test_data=(-1 "toto") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(-1 "cpu") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(-1 "cpua" "cpud") + test_get_max_cpuid_from_sysfs "${test_data[@]}" + + test_data=(-1 "cpufreq" "cpuidle") + test_get_max_cpuid_from_sysfs "${test_data[@]}" +else + plan_skip_all "Linux specific tests." +fi diff --git a/tests/unit/test_get_max_cpuid_from_sysfs_cxx b/tests/unit/test_get_max_cpuid_from_sysfs_cxx new file mode 100755 index 0000000..2283a04 --- /dev/null +++ b/tests/unit/test_get_max_cpuid_from_sysfs_cxx @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +if [ "x${URCU_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$URCU_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../utils/utils.sh" +fi + +# shellcheck source=../utils/utils.sh +source "$UTILSSH" + +# shellcheck source=../../utils/tap.sh +source "$URCU_TESTS_SRCDIR/utils/tap.sh" + +CURDIR="${URCU_TESTS_BUILDDIR}/unit" + +STD_OUTPUT="/dev/null" +STD_ERROR="/dev/null" + +NUM_TESTS=13 + +TESTDIR=$(mktemp -d) + +populate_testdir() { + local cpus=("$@") + + mkdir "$TESTDIR" + + for i in "${cpus[@]}"; do + mkdir "$TESTDIR/$i" + done +} + +test_get_max_cpuid_from_sysfs_cxx() { + local num_cpus=$1 + shift + local current_cpus=("$@") + local result + + populate_testdir "${current_cpus[@]}" >"$STD_OUTPUT" 2>"$STD_ERROR" + result=$("${CURDIR}/get_max_cpuid_from_sysfs_cxx" "$TESTDIR") + is "$result" "$num_cpus" "get_max_cpuid_from_sysfs_cxx - cpu set: '${current_cpus[*]}', expected: '$num_cpus', result: '$result'" + rm -rf "$TESTDIR" +} + +if [ "$URCU_TESTS_OS_TYPE" == "linux" ]; then + plan_tests $NUM_TESTS + + diag "get_max_cpuid_from_sysfs_cxx" + + test_data=(0 "cpu0") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(1 "cpu0" "cpu1") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(1 "cpu1" "cpu0") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(3 "cpu3") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(99 "cpu99") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(3 "cpu0" "cpu3") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(3 "cpufreq" "cpuidle" "cpu0" "cpu1" "cpu2" "cpu3") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(0 "cpu" "cpu0") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(5 "cpu" "cpu5") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + + test_data=(-1 "toto") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(-1 "cpu") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(-1 "cpua" "cpud") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" + + test_data=(-1 "cpufreq" "cpuidle") + test_get_max_cpuid_from_sysfs_cxx "${test_data[@]}" +else + plan_skip_all "Linux specific tests." +fi diff --git a/tests/unit/test_get_possible_cpus_array_len.c b/tests/unit/test_get_possible_cpus_array_len.c new file mode 100644 index 0000000..c5ab2b4 --- /dev/null +++ b/tests/unit/test_get_possible_cpus_array_len.c @@ -0,0 +1,30 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include + +#include "tap.h" + +#include "compat-smp.h" + +int main(void) +{ + int ret; + + plan_tests(2); + + ret = get_possible_cpus_array_len(); + ok(ret > 0, "get_possible_cpus_array_len (%d > 0)", ret); + +#ifdef __linux__ + ret = get_num_possible_cpus_fallback(); + ok(ret > 0, "get_num_possible_cpus_fallback (%d > 0)", ret); +#else + skip(1, "Linux specific test."); +#endif + + return exit_status(); +} diff --git a/tests/unit/test_get_possible_cpus_array_len_cxx.cpp b/tests/unit/test_get_possible_cpus_array_len_cxx.cpp new file mode 100644 index 0000000..536c509 --- /dev/null +++ b/tests/unit/test_get_possible_cpus_array_len_cxx.cpp @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "test_get_possible_cpus_array_len.c" diff --git a/tests/unit/test_lfstack.c b/tests/unit/test_lfstack.c new file mode 100644 index 0000000..03d1632 --- /dev/null +++ b/tests/unit/test_lfstack.c @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * test_lfstack.c + * + * Userspace RCU library - test wftack race conditions + */ + +#define _LGPL_SOURCE + +#include + +#include + +#include + +#include "tap.h" + +#define NR_TESTS 1 +#define NR_PRODUCERS 4 +#define LOOP 100 + +static void async_run(struct cds_lfs_stack *queue) +{ + struct cds_lfs_node *node = malloc(sizeof(*node)); + + cds_lfs_node_init(node); + + cds_lfs_push(queue, node); +} + +static void *async_loop(void *queue) +{ + size_t k = 0; + + while (k < LOOP * NR_PRODUCERS) { + free(cds_lfs_pop_blocking(queue)); + ++k; + } + + return NULL; +} + +static void *spawn_jobs(void *queue) +{ + for (size_t k = 0; k < LOOP; ++k) { + async_run(queue); + } + + return 0; +} + +int main(void) +{ + pthread_t consumer; + pthread_t producers[NR_PRODUCERS]; + struct cds_lfs_stack queue; + + plan_tests(NR_TESTS); + + cds_lfs_init(&queue); + pthread_create(&consumer, NULL, async_loop, &queue); + + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_create(&producers[k], NULL, spawn_jobs, &queue); + } + + pthread_join(consumer, NULL); + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_join(producers[k], NULL); + } + + ok1("No race conditions"); + + return exit_status(); +} diff --git a/tests/unit/test_uatomic.c b/tests/unit/test_uatomic.c index 5884455..d9c70e0 100644 --- a/tests/unit/test_uatomic.c +++ b/tests/unit/test_uatomic.c @@ -1,24 +1,6 @@ -/* - * test_uatomic.c - * - * Userspace RCU library - test atomic operations - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later #include #include @@ -27,14 +9,18 @@ #define NR_TESTS 17 +#define BYTE_PER_LONG (sizeof(unsigned long) / sizeof(unsigned char)) +#define SHORT_PER_LONG (sizeof(unsigned long) / sizeof(unsigned short)) +#define INT_PER_LONG (sizeof(unsigned long) / sizeof(unsigned int)) + struct testvals { #ifdef UATOMIC_HAS_ATOMIC_BYTE - unsigned char c; + unsigned char c[BYTE_PER_LONG]; #endif #ifdef UATOMIC_HAS_ATOMIC_SHORT - unsigned short s; + unsigned short s[SHORT_PER_LONG]; #endif - unsigned int i; + unsigned int i[INT_PER_LONG]; unsigned long l; }; @@ -93,25 +79,36 @@ do { \ int main(void) { - int nr_run = 2; + int nr_run = INT_PER_LONG + 1; + unsigned long i; + #ifdef UATOMIC_HAS_ATOMIC_BYTE - nr_run += 1; + nr_run += BYTE_PER_LONG; #endif #ifdef UATOMIC_HAS_ATOMIC_SHORT - nr_run += 1; + nr_run += SHORT_PER_LONG; #endif plan_tests(nr_run * NR_TESTS); #ifdef UATOMIC_HAS_ATOMIC_BYTE - diag("Test atomic ops on byte"); - do_test(&vals.c); + for (i = 0; i < BYTE_PER_LONG; i++) { + diag("Test atomic ops on byte with %lu byte offset from long alignment", + i); + do_test(&vals.c[i]); + } #endif #ifdef UATOMIC_HAS_ATOMIC_SHORT - diag("Test atomic ops on short"); - do_test(&vals.s); + for (i = 0; i < SHORT_PER_LONG; i++) { + diag("Test atomic ops on short with %lu byte offset from long alignment", + i * sizeof(unsigned short)); + do_test(&vals.s[i]); + } #endif - diag("Test atomic ops on int"); - do_test(&vals.i); + for (i = 0; i < INT_PER_LONG; i++) { + diag("Test atomic ops on int with %lu byte offset from long alignment", + i * sizeof(unsigned int)); + do_test(&vals.i[i]); + } diag("Test atomic ops on long"); do_test(&vals.l); diff --git a/tests/unit/test_uatomic_cxx.cpp b/tests/unit/test_uatomic_cxx.cpp index c5ad40d..0f9e275 100644 --- a/tests/unit/test_uatomic_cxx.cpp +++ b/tests/unit/test_uatomic_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_uatomic.c" diff --git a/tests/unit/test_urcu_multiflavor-bp.c b/tests/unit/test_urcu_multiflavor-bp.c index 199818b..460cfa6 100644 --- a/tests/unit/test_urcu_multiflavor-bp.c +++ b/tests/unit/test_urcu_multiflavor-bp.c @@ -1,30 +1,15 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor-bp.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE #endif -#define RCU_SIGNAL #include #include "test_urcu_multiflavor.h" diff --git a/tests/unit/test_urcu_multiflavor-bp_cxx.cpp b/tests/unit/test_urcu_multiflavor-bp_cxx.cpp index 65bb67c..d38d159 100644 --- a/tests/unit/test_urcu_multiflavor-bp_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor-bp_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor-bp.c" diff --git a/tests/unit/test_urcu_multiflavor-mb.c b/tests/unit/test_urcu_multiflavor-mb.c index e4ba6a4..e2d4878 100644 --- a/tests/unit/test_urcu_multiflavor-mb.c +++ b/tests/unit/test_urcu_multiflavor-mb.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor-mb.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DYNAMIC_LINK_TEST diff --git a/tests/unit/test_urcu_multiflavor-mb_cxx.cpp b/tests/unit/test_urcu_multiflavor-mb_cxx.cpp index 606b66d..67691de 100644 --- a/tests/unit/test_urcu_multiflavor-mb_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor-mb_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor-mb.c" diff --git a/tests/unit/test_urcu_multiflavor-memb.c b/tests/unit/test_urcu_multiflavor-memb.c index 583f2e1..43d0afa 100644 --- a/tests/unit/test_urcu_multiflavor-memb.c +++ b/tests/unit/test_urcu_multiflavor-memb.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor-memb.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DYNAMIC_LINK_TEST diff --git a/tests/unit/test_urcu_multiflavor-memb_cxx.cpp b/tests/unit/test_urcu_multiflavor-memb_cxx.cpp index adda7d0..d9fabef 100644 --- a/tests/unit/test_urcu_multiflavor-memb_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor-memb_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor-memb.c" diff --git a/tests/unit/test_urcu_multiflavor-qsbr.c b/tests/unit/test_urcu_multiflavor-qsbr.c index 64f32f4..fa478ca 100644 --- a/tests/unit/test_urcu_multiflavor-qsbr.c +++ b/tests/unit/test_urcu_multiflavor-qsbr.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor-qsbr.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DYNAMIC_LINK_TEST diff --git a/tests/unit/test_urcu_multiflavor-qsbr_cxx.cpp b/tests/unit/test_urcu_multiflavor-qsbr_cxx.cpp index a4039ed..b52f783 100644 --- a/tests/unit/test_urcu_multiflavor-qsbr_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor-qsbr_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor-qsbr.c" diff --git a/tests/unit/test_urcu_multiflavor-signal.c b/tests/unit/test_urcu_multiflavor-signal.c deleted file mode 100644 index 816c615..0000000 --- a/tests/unit/test_urcu_multiflavor-signal.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * test_urcu_multiflavor-signal.c - * - * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef DYNAMIC_LINK_TEST -#define _LGPL_SOURCE -#endif - -#define RCU_SIGNAL -#include -#include "test_urcu_multiflavor.h" - -int test_mf_signal(void) -{ - rcu_register_thread(); - rcu_read_lock(); - rcu_read_unlock(); - synchronize_rcu(); - rcu_unregister_thread(); - return 0; -} diff --git a/tests/unit/test_urcu_multiflavor-signal_cxx.cpp b/tests/unit/test_urcu_multiflavor-signal_cxx.cpp deleted file mode 100644 index 0f77550..0000000 --- a/tests/unit/test_urcu_multiflavor-signal_cxx.cpp +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include "test_urcu_multiflavor-signal.c" diff --git a/tests/unit/test_urcu_multiflavor.c b/tests/unit/test_urcu_multiflavor.c index 225161a..ef7605a 100644 --- a/tests/unit/test_urcu_multiflavor.c +++ b/tests/unit/test_urcu_multiflavor.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -27,12 +13,11 @@ int main(void) { - plan_tests(5); + plan_tests(4); ok1(!test_mf_memb()); ok1(!test_mf_mb()); - ok1(!test_mf_signal()); ok1(!test_mf_qsbr()); ok1(!test_mf_bp()); diff --git a/tests/unit/test_urcu_multiflavor.h b/tests/unit/test_urcu_multiflavor.h index 419ad5d..27e59f0 100644 --- a/tests/unit/test_urcu_multiflavor.h +++ b/tests/unit/test_urcu_multiflavor.h @@ -1,29 +1,14 @@ +// SPDX-FileCopyrightText: 2012 Lai Jiangshan +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor.h - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * Copyright February 2012 - Lai Jiangshan - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ extern int test_mf_memb(void); extern int test_mf_mb(void); -extern int test_mf_signal(void); extern int test_mf_qsbr(void); extern int test_mf_bp(void); diff --git a/tests/unit/test_urcu_multiflavor_cxx.cpp b/tests/unit/test_urcu_multiflavor_cxx.cpp index 5a370b3..6794731 100644 --- a/tests/unit/test_urcu_multiflavor_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor.c" diff --git a/tests/unit/test_urcu_multiflavor_single_unit.c b/tests/unit/test_urcu_multiflavor_single_unit.c index aff292a..5548744 100644 --- a/tests/unit/test_urcu_multiflavor_single_unit.c +++ b/tests/unit/test_urcu_multiflavor_single_unit.c @@ -1,23 +1,9 @@ +// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* - * test_urcu_multiflavor.c - * * Userspace RCU library - test multiple RCU flavors into one program - * - * Copyright February 2012 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DYNAMIC_LINK_TEST @@ -27,7 +13,6 @@ #include #include #include -#include #include #include @@ -63,16 +48,6 @@ static int test_mf_memb(void) return 0; } -static int test_mf_signal(void) -{ - urcu_signal_register_thread(); - urcu_signal_read_lock(); - urcu_signal_read_unlock(); - urcu_signal_synchronize_rcu(); - urcu_signal_unregister_thread(); - return 0; -} - static int test_mf_qsbr(void) { urcu_qsbr_register_thread(); @@ -85,12 +60,11 @@ static int test_mf_qsbr(void) int main(void) { - plan_tests(5); + plan_tests(4); ok1(!test_mf_mb()); ok1(!test_mf_bp()); ok1(!test_mf_memb()); - ok1(!test_mf_signal()); ok1(!test_mf_qsbr()); return exit_status(); diff --git a/tests/unit/test_urcu_multiflavor_single_unit_cxx.cpp b/tests/unit/test_urcu_multiflavor_single_unit_cxx.cpp index ff06d6d..f7cdf21 100644 --- a/tests/unit/test_urcu_multiflavor_single_unit_cxx.cpp +++ b/tests/unit/test_urcu_multiflavor_single_unit_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "test_urcu_multiflavor_single_unit.c" diff --git a/tests/unit/test_wfcqueue.c b/tests/unit/test_wfcqueue.c new file mode 100644 index 0000000..45c4988 --- /dev/null +++ b/tests/unit/test_wfcqueue.c @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * test_wfcqueue.c + * + * Userspace RCU library - test wfcqueue race conditions + */ + +#define _LGPL_SOURCE + +#include + +#include + +#include + +#include "tap.h" + +#define NR_TESTS 1 +#define NR_PRODUCERS 4 +#define LOOP 100 + +struct queue { + struct cds_wfcq_head head; + struct cds_wfcq_tail tail; +}; + +static void async_run(struct queue *queue) +{ + struct cds_wfcq_node *node = malloc(sizeof(*node)); + + cds_wfcq_node_init(node); + + cds_wfcq_enqueue(&queue->head, &queue->tail, node); +} +static void do_async_loop(size_t *k, struct queue *queue) +{ + struct queue my_queue; + enum cds_wfcq_ret state; + struct cds_wfcq_node *node, *next; + + cds_wfcq_init(&my_queue.head, &my_queue.tail); + + state = cds_wfcq_splice_blocking(&my_queue.head, + &my_queue.tail, + &queue->head, + &queue->tail); + + if (state == CDS_WFCQ_RET_SRC_EMPTY) { + return; + } + + __cds_wfcq_for_each_blocking_safe(&my_queue.head, + &my_queue.tail, + node, next) { + free(node); + (*k)++; + } +} + +static void *async_loop(void *queue) +{ + size_t k = 0; + + while (k < LOOP * NR_PRODUCERS) { + (void) poll(NULL, 0, 10); + do_async_loop(&k, queue); + } + + return NULL; +} + +static void *spawn_jobs(void *queue) +{ + for (size_t k = 0; k < LOOP; ++k) { + async_run(queue); + } + + return 0; +} + +int main(void) +{ + pthread_t consumer; + pthread_t producers[NR_PRODUCERS]; + struct queue queue; + + plan_tests(NR_TESTS); + + cds_wfcq_init(&queue.head, &queue.tail); + pthread_create(&consumer, NULL, async_loop, &queue); + + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_create(&producers[k], NULL, spawn_jobs, &queue); + } + + pthread_join(consumer, NULL); + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_join(producers[k], NULL); + } + + ok1("No race conditions"); + + return exit_status(); +} diff --git a/tests/unit/test_wfqueue.c b/tests/unit/test_wfqueue.c new file mode 100644 index 0000000..944c49a --- /dev/null +++ b/tests/unit/test_wfqueue.c @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * test_wfqueue.c + * + * Userspace RCU library - test wfqueue race conditions + */ + +#define _LGPL_SOURCE + +#include + +#include + +#define CDS_WFQ_DEPRECATED +#include + +#include "tap.h" + +#define NR_TESTS 1 +#define NR_PRODUCERS 4 +#define LOOP 100 + +static void async_run(struct cds_wfq_queue *queue) +{ + struct cds_wfq_node *node = malloc(sizeof(*node)); + + cds_wfq_node_init(node); + + cds_wfq_enqueue(queue, node); +} + +static void *async_loop(void *queue) +{ + size_t k = 0; + + while (k < LOOP * NR_PRODUCERS) { + free(cds_wfq_dequeue_blocking(queue)); + ++k; + } + + return NULL; +} + +static void *spawn_jobs(void *queue) +{ + for (size_t k = 0; k < LOOP; ++k) { + async_run(queue); + } + + return 0; +} + +int main(void) +{ + pthread_t consumer; + pthread_t producers[NR_PRODUCERS]; + struct cds_wfq_queue queue; + + plan_tests(NR_TESTS); + + cds_wfq_init(&queue); + pthread_create(&consumer, NULL, async_loop, &queue); + + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_create(&producers[k], NULL, spawn_jobs, &queue); + } + + pthread_join(consumer, NULL); + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_join(producers[k], NULL); + } + + ok1("No race conditions"); + + return exit_status(); +} diff --git a/tests/unit/test_wfstack.c b/tests/unit/test_wfstack.c new file mode 100644 index 0000000..17901ce --- /dev/null +++ b/tests/unit/test_wfstack.c @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: 2023 Olivier Dion +// +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * test_wfstack.c + * + * Userspace RCU library - test wftack race conditions + */ + +#define _LGPL_SOURCE + +#include + +#include + +#include + +#include "tap.h" + +#define NR_TESTS 1 +#define NR_PRODUCERS 4 +#define LOOP 100 + +static void async_run(struct cds_wfs_stack *queue) +{ + struct cds_wfs_node *node = malloc(sizeof(*node)); + + cds_wfs_node_init(node); + + cds_wfs_push(queue, node); +} + +static void *async_loop(void *queue) +{ + size_t k = 0; + + while (k < LOOP * NR_PRODUCERS) { + free(cds_wfs_pop_blocking(queue)); + ++k; + } + + return NULL; +} + +static void *spawn_jobs(void *queue) +{ + for (size_t k = 0; k < LOOP; ++k) { + async_run(queue); + } + + return 0; +} + +int main(void) +{ + pthread_t consumer; + pthread_t producers[NR_PRODUCERS]; + struct cds_wfs_stack queue; + + plan_tests(NR_TESTS); + + cds_wfs_init(&queue); + pthread_create(&consumer, NULL, async_loop, &queue); + + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_create(&producers[k], NULL, spawn_jobs, &queue); + } + + pthread_join(consumer, NULL); + for (size_t k = 0; k < NR_PRODUCERS; ++k) { + pthread_join(producers[k], NULL); + } + + ok1("No race conditions"); + + return exit_status(); +} diff --git a/tests/unit/urcu-asm.c b/tests/unit/urcu-asm.c index b616d34..202854f 100644 --- a/tests/unit/urcu-asm.c +++ b/tests/unit/urcu-asm.c @@ -1,23 +1,11 @@ +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + /* * urcu-asm.c * * Userspace RCU library - assembly dump of primitives - * - * Copyright February 2009 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include diff --git a/tests/unit/urcu-asm_cxx.cpp b/tests/unit/urcu-asm_cxx.cpp index efba54c..883e7b9 100644 --- a/tests/unit/urcu-asm_cxx.cpp +++ b/tests/unit/urcu-asm_cxx.cpp @@ -1,3 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-FileCopyrightText: 2023 EfficiOS Inc. +// +// SPDX-License-Identifier: GPL-2.0-or-later #include "urcu-asm.c" diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index d39f797..605d64c 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -1,22 +1,13 @@ +# SPDX-FileCopyrightText: 2023 EfficiOS Inc. +# +# SPDX-License-Identifier: MIT + AM_CPPFLAGS += -I$(top_srcdir)/src noinst_LIBRARIES = libtap.a libtap_a_SOURCES = tap.c tap.h -SCRIPT_LIST = tap.sh tap-driver.sh - -dist_check_SCRIPTS = $(SCRIPT_LIST) - -all-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - cp -f $(srcdir)/$$script $(builddir); \ - done; \ - fi - -clean-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - rm -f $(builddir)/$$script; \ - done; \ - fi +dist_check_SCRIPTS = \ + tap-driver.sh \ + tap.sh \ + utils.sh diff --git a/tests/utils/env.sh.in b/tests/utils/env.sh.in new file mode 100644 index 0000000..6fa2733 --- /dev/null +++ b/tests/utils/env.sh.in @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +### Base paths to test suite ### +if [ "x${URCU_TESTS_SRCDIR:-}" = "x" ]; then + URCU_TESTS_SRCDIR="@abs_top_srcdir@/tests" +fi +export URCU_TESTS_SRCDIR + +if [ "x${URCU_TESTS_BUILDDIR:-}" = "x" ]; then + URCU_TESTS_BUILDDIR="@abs_top_builddir@/tests" +fi +export URCU_TESTS_BUILDDIR + + +### External Tools ### +if [ "x${URCU_TESTS_NPROC_BIN:-}" = "x" ]; then + URCU_TESTS_NPROC_BIN="@NPROC@" +fi +export URCU_TESTS_NPROC_BIN + +if [ "x${URCU_TESTS_GETCONF_BIN:-}" = "x" ]; then + URCU_TESTS_GETCONF_BIN="@GETCONF@" +fi +export URCU_TESTS_GETCONF_BIN + +if [ "x${URCU_TESTS_TIME_BIN:-}" = "x" ]; then + URCU_TESTS_TIME_BIN="@TIME@" +fi +export URCU_TESTS_TIME_BIN + diff --git a/tests/utils/tap.h b/tests/utils/tap.h index 629c847..966706f 100644 --- a/tests/utils/tap.h +++ b/tests/utils/tap.h @@ -41,7 +41,7 @@ __attribute__((format(TAP_PRINTF_FORMAT, 5, 6))) unsigned int _gen_result(int, const char *, const char *, unsigned int, const char *, ...); int plan_no_plan(void); -__attribute__((noreturn)) +__attribute__((__noreturn__)) int plan_skip_all(const char *); int plan_tests(unsigned int); diff --git a/tests/utils/tap.sh b/tests/utils/tap.sh index 24ac1aa..47b1407 100755 --- a/tests/utils/tap.sh +++ b/tests/utils/tap.sh @@ -1,20 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # -# Copyright 2010 Patrick LeBoutillier +# SPDX-License-Identifier: GPL-3.0-or-later # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# SPDX-FileCopyrightText: 2010 Patrick LeBoutillier # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - _version='1.01' @@ -65,7 +54,7 @@ OTHER: diag MSG EXAMPLE: - #!/bin/bash + #!/usr/bin/env bash . tap-functions diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh new file mode 100755 index 0000000..5c96fb0 --- /dev/null +++ b/tests/utils/utils.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# SPDX-FileCopyrightText: 2022 EfficiOS Inc. +# + +# This file is meant to be sourced at the start of shell script-based tests. + + +# Error out when encountering an undefined variable +set -u + +# If "readlink -f" is available, get a resolved absolute path to the +# tests source dir, otherwise make do with a relative path. +scriptdir="$(dirname "${BASH_SOURCE[0]}")" +if readlink -f "." >/dev/null 2>&1; then + testsdir=$(readlink -f "$scriptdir/..") +else + testsdir="$scriptdir/.." +fi + +# The OS on which we are running. See [1] for possible values of 'uname -s'. +# We do a bit of translation to ease our life down the road for comparison. +# Export it so that called executables can use it. +# [1] https://en.wikipedia.org/wiki/Uname#Examples +if [ "x${URCU_TESTS_OS_TYPE:-}" = "x" ]; then + URCU_TESTS_OS_TYPE="$(uname -s)" + case "$URCU_TESTS_OS_TYPE" in + MINGW*) + URCU_TESTS_OS_TYPE="mingw" + ;; + Darwin) + URCU_TESTS_OS_TYPE="darwin" + ;; + Linux) + URCU_TESTS_OS_TYPE="linux" + ;; + CYGWIN*) + URCU_TESTS_OS_TYPE="cygwin" + ;; + *) + URCU_TESTS_OS_TYPE="unsupported" + ;; + esac +fi +export URCU_TESTS_OS_TYPE + +# Allow overriding the source and build directories +if [ "x${URCU_TESTS_SRCDIR:-}" = "x" ]; then + URCU_TESTS_SRCDIR="$testsdir" +fi +export URCU_TESTS_SRCDIR + +if [ "x${URCU_TESTS_BUILDDIR:-}" = "x" ]; then + URCU_TESTS_BUILDDIR="$testsdir" +fi +export URCU_TESTS_BUILDDIR + +# Source the generated environment file if it's present. +if [ -f "${URCU_TESTS_BUILDDIR}/utils/env.sh" ]; then + # shellcheck source=./env.sh + . "${URCU_TESTS_BUILDDIR}/utils/env.sh" +fi + + +### External Tools ### + +if [ "x${URCU_TESTS_NPROC_BIN:-}" = "x" ]; then + URCU_TESTS_NPROC_BIN="nproc" +fi +export URCU_TESTS_NPROC_BIN + +if [ "x${URCU_TESTS_GETCONF_BIN:-}" = "x" ]; then + URCU_TESTS_GETCONF_BIN="getconf" +fi +export URCU_TESTS_GETCONF_BIN + + +# By default, it will not source tap.sh. If you to tap output directly from +# the test script, define the 'SH_TAP' variable to '1' before sourcing this +# script. +if [ "x${SH_TAP:-}" = x1 ]; then + # shellcheck source=./tap.sh + . "${URCU_TESTS_SRCDIR}/utils/tap.sh" +fi + + +### Functions ### + +# Print the number of online CPUs, fallback to '1' if no tools to count CPUs +# are found in the environment. +urcu_nproc() { + if command -v "${URCU_TESTS_NPROC_BIN}" >/dev/null 2>&1; then + "${URCU_TESTS_NPROC_BIN}" + elif command -v "${URCU_TESTS_GETCONF_BIN}" >/dev/null 2>&1; then + "${URCU_TESTS_GETCONF_BIN}" _NPROCESSORS_ONLN + else + # Fallback to '1' + echo 1 + fi +} + +# Shell implementation of the 'seq' command. +urcu_xseq() { + local i=$1 + + while [[ "$i" -le "$2" ]]; do + echo "$i" + i=$(( i + 1 )) + done +}