From: Ondřej Surý Date: Tue, 11 May 2021 10:29:57 +0000 (+0200) Subject: Compile with jemalloc to reduce memory allocator contention X-Git-Tag: v9.17.17~40^2~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f1c525625675e7e5e0953a78adefe9e21fc1462;p=thirdparty%2Fbind9.git Compile with jemalloc to reduce memory allocator contention The jemalloc allocator is scalable high performance allocator, this is the first in the series of commits that will add jemalloc as a memory allocator for BIND 9. This commit adds configure.ac check and Makefile modifications to use jemalloc as BIND 9 allocator. --- diff --git a/configure.ac b/configure.ac index 03fd0b2725e..7ada1b61eed 100644 --- a/configure.ac +++ b/configure.ac @@ -1376,6 +1376,17 @@ AC_SUBST([CMOCKA_LIBS]) AM_CONDITIONAL([HAVE_CMOCKA], [test "$with_cmocka" = "yes"]) +# +# +# +AC_MSG_CHECKING([for jemalloc]) +PKG_CHECK_MODULES([JEMALLOC], [jemalloc >= 5], [] + [AC_MSG_WARN([Using jemalloc 5 is recommended]) + PKG_CHECK_MODULES([JEMALLOC], [jemalloc], [], + [AC_MSG_ERROR([jemalloc not found])])]) +AC_SUBST([JEMALLOC_CFLAGS]) +AC_SUBST([JEMALLOC_LIBS]) + # # was --with-tuning specified? # diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index deed17c9a9c..1b5898817bf 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -230,6 +230,7 @@ libisc_la_SOURCES = \ libisc_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ + $(JEMALLOC_CPPFLAGS) \ $(LIBISC_CFLAGS) \ $(LIBUV_CFLAGS) \ $(OPENSSL_CFLAGS) \ @@ -240,6 +241,7 @@ libisc_la_LDFLAGS = \ -release "$(PACKAGE_VERSION)" libisc_la_LIBADD = \ + $(JEMALLOC_LIBS) \ $(LIBUV_LIBS) \ $(OPENSSL_LIBS) \ $(ZLIB_LIBS)