]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Build with liburcu, Userspace RCU
authorOndřej Surý <ondrej@isc.org>
Tue, 7 Mar 2023 14:13:03 +0000 (15:13 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 10 Mar 2023 16:31:28 +0000 (17:31 +0100)
BIND needs a collection of standard lock-free data structures,
which we can find in liburcu, along with its RCU safe memory
reclamation machinery. We will use liburcu's QSBR variant instead
of the home-grown isc_qsbr.

.clang-format
.clang-format.headers
configure.ac
doc/arm/build.inc.rst
lib/isc/Makefile.am

index 4aac13c8b7a33e79fc413fad8ebd05158db08028..6a8388bc918cebc932998164c978aff326dc2f7a 100644 (file)
@@ -34,6 +34,10 @@ PointerAlignment: Right
 PointerBindsToType: false
 IncludeBlocks: Regroup
 IncludeCategories:
+  - Regex:           '^<(urcu\.h|urcu/urcu-|urcu-)'
+    Priority:        2
+  - Regex:           '^<urcu/'
+    Priority:        3
   - Regex:           '^<isc/'
     Priority:        5
   - Regex:           '^<(pk11|pkcs11)/'
@@ -59,9 +63,9 @@ IncludeCategories:
   - Regex:           '^<tests/'
     Priority:        100
   - Regex:           '<openssl/'
-    Priority:        1
+    Priority:        4
   - Regex:           '<(mysql|protobuf-c)/'
-    Priority:        1
+    Priority:        4
   - Regex:           '.*'
     Priority:        0
 IndentExternBlock: NoIndent
@@ -74,3 +78,4 @@ PenaltyBreakString: 80
 PenaltyExcessCharacter: 100
 Standard: Cpp11
 ContinuationIndentWidth: 8
+ForEachMacros: [ 'cds_lfs_for_each', 'cds_lfs_for_each_safe', 'cds_list_for_each_entry_safe' ]
index 88abddd2c8e5a0c41b0608c2cc0f8ceebbcf560e..4b4d091fa2818b29802815e2696eb6e71a8b16c0 100644 (file)
@@ -34,24 +34,40 @@ PointerAlignment: Right
 PointerBindsToType: false
 IncludeBlocks: Regroup
 IncludeCategories:
-  - Regex:           '^<isc/'
+  - Regex:           '^<(urcu/urcu-|urcu-)'
     Priority:        2
-  - Regex:           '^<dns/'
+  - Regex:           '^<urcu/'
     Priority:        3
-  - Regex:           '^<iscccc/'
-    Priority:        4
-  - Regex:           '^<isccfg/'
+  - Regex:           '^<isc/'
     Priority:        5
+  - Regex:           '^<(pk11|pkcs11)/'
+    Priority:        10
+  - Regex:           '^<dns/'
+    Priority:        15
+  - Regex:           '^<dst/'
+    Priority:        20
+  - Regex:           '^<isccc/'
+    Priority:        25
+  - Regex:           '^<isccfg/'
+    Priority:        30
   - Regex:           '^<ns/'
-    Priority:        6
-  - Regex:           '^(<[^/]*)/)'
-    Priority:        8
+    Priority:        35
+  - Regex:           '^<irs/'
+    Priority:        40
+  - Regex:           '^<(dig|named|rndc|confgen|dlz)/'
+    Priority:        50
+  - Regex:           '^<dlz_'
+    Priority:        55
+  - Regex:           '^".*"'
+    Priority:        99
   - Regex:           '^<tests/'
-    Priority:        10
-  - Regex:           '<[[:alnum:].]+>'
-    Priority:        1
-  - Regex:           '".*"'
-    Priority:        9
+    Priority:        100
+  - Regex:           '<openssl/'
+    Priority:        4
+  - Regex:           '<(mysql|protobuf-c)/'
+    Priority:        4
+  - Regex:           '.*'
+    Priority:        0
 IndentExternBlock: NoIndent
 KeepEmptyLinesAtTheStartOfBlocks: false
 MaxEmptyLinesToKeep: 1
index b38a82663db163c6b8a22edd844f8bc1686c5bdf..e0e893b50bd345938e401f2a637774abe62d80f4 100644 (file)
@@ -611,6 +611,9 @@ AC_CHECK_DECLS([UV_UDP_LINUX_RECVERR], [], [], [[#include <uv.h>]])
 
 AX_RESTORE_FLAGS([libuv])
 
+# userspace-rcu (QSBR variant)
+PKG_CHECK_MODULES([LIBURCU], [liburcu-qsbr liburcu-cds])
+
 # [pairwise: --enable-doh --with-libnghttp2=auto, --enable-doh --with-libnghttp2=yes, --disable-doh]
 AC_ARG_ENABLE([doh],
              [AS_HELP_STRING([--disable-doh], [disable DNS over HTTPS, removes dependency on libnghttp2 (default is --enable-doh)])],
index 93a08ecadc4590934f3370658b1f641b683b55e2..f47ca5d651a124359e6257d0a1dd58943418bec0 100644 (file)
@@ -56,6 +56,7 @@ Required Libraries
 To build BIND 9, the following packages must be installed:
 
 - ``libcrypto``, ``libssl``
+- ``liburcu``
 - ``libuv``
 - ``perl``
 - ``pkg-config`` / ``pkgconfig`` / ``pkgconf``
@@ -73,6 +74,9 @@ in a nonstandard location, specify the prefix using
 PKCS#11 hardware service module for cryptographic operations,
 ``engine_pkcs11`` from the OpenSC project must be compiled and used.
 
+The Userspace RCU library ``liburcu`` (https://liburcu.org/) is used
+for lock-free data structures and concurrent safe memory reclamation.
+
 On Linux, process capabilities are managed in user space using the
 ``libcap`` library
 (https://git.kernel.org/pub/scm/libs/libcap/libcap.git/), which can be
index 8e88e69311014223d51ba014aade4ffca294e52a..e822b7345279fe4245cc61c7d79ccdba372918f3 100644 (file)
@@ -212,6 +212,7 @@ endif USE_ISC_RWLOCK
 libisc_la_CPPFLAGS =           \
        $(AM_CPPFLAGS)          \
        $(LIBISC_CFLAGS)        \
+       $(LIBURCU_CFLAGS)       \
        $(LIBUV_CFLAGS)         \
        $(OPENSSL_CFLAGS)       \
        $(ZLIB_CFLAGS)
@@ -221,6 +222,7 @@ libisc_la_LDFLAGS =         \
        -release "$(PACKAGE_VERSION)"
 
 libisc_la_LIBADD =             \
+       $(LIBURCU_LIBS)         \
        $(LIBUV_LIBS)           \
        $(OPENSSL_LIBS)         \
        $(ZLIB_LIBS)