浏览代码

Issue 50992 - Bump jemalloc version and enable profiling

Description:
jemalloc 5.2.1 release introduced a number of fixes.
https://github.com/jemalloc/jemalloc/releases/tag/5.2.1

Additionally:
* Override default page and hugepage sizes, because builder machines may not match the target systems.
* Enable profiling by default (--enable-perf), so it can be used for troubleshooting.

Fixes: https://pagure.io/389-ds-base/issue/50992

Reviewed by: mreynolds (Thanks!)
Viktor Ashirov 5 年之前
父节点
当前提交
8895fc4b4b
共有 2 个文件被更改,包括 25 次插入3 次删除
  1. 21 3
      rpm/389-ds-base.spec.in
  2. 4 0
      wrappers/systemd.template.service.custom.conf.in

+ 21 - 3
rpm/389-ds-base.spec.in

@@ -4,7 +4,7 @@
 %global bundle_jemalloc __BUNDLE_JEMALLOC__
 %global bundle_jemalloc __BUNDLE_JEMALLOC__
 %if %{bundle_jemalloc}
 %if %{bundle_jemalloc}
 %global jemalloc_name jemalloc
 %global jemalloc_name jemalloc
-%global jemalloc_ver 5.2.0
+%global jemalloc_ver 5.2.1
 %endif
 %endif
 
 
 # This is used in certain builds to help us know if it has extra features.
 # This is used in certain builds to help us know if it has extra features.
@@ -367,12 +367,30 @@ LEGACY_FLAGS="--disable-legacy --disable-perl"
 %endif
 %endif
 
 
 %if %{bundle_jemalloc}
 %if %{bundle_jemalloc}
+# Override page size, bz #1545539
+# 4K
+%ifarch %ix86 %arm x86_64 s390x
+%define lg_page --with-lg-page=12
+%endif
+
+# 64K
+%ifarch ppc64 ppc64le aarch64
+%define lg_page --with-lg-page=16
+%endif
+
+# Override huge page size on aarch64
+# 2M instead of 512M
+%ifarch aarch64
+%define lg_hugepage --with-lg-hugepage=21
+%endif
+
 # Build jemalloc
 # Build jemalloc
 pushd ../%{jemalloc_name}-%{jemalloc_ver}
 pushd ../%{jemalloc_name}-%{jemalloc_ver}
 %configure \
 %configure \
         --libdir=%{_libdir}/%{pkgname}/lib \
         --libdir=%{_libdir}/%{pkgname}/lib \
-        --bindir=%{_libdir}/%{pkgname}/bin
-make
+        --bindir=%{_libdir}/%{pkgname}/bin \
+        --enable-prof %{lg_page} %{lg_hugepage}
+make %{?_smp_mflags}
 popd
 popd
 %endif
 %endif
 
 

+ 4 - 0
wrappers/systemd.template.service.custom.conf.in

@@ -51,3 +51,7 @@ TimeoutStopSec=600
 
 
 # Preload jemalloc
 # Preload jemalloc
 Environment=LD_PRELOAD=@libdir@/@package_name@/lib/libjemalloc.so.2
 Environment=LD_PRELOAD=@libdir@/@package_name@/lib/libjemalloc.so.2
+
+# Uncomment to enable leak checking using jemalloc's heap profiler
+# https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Leak-Checking
+#Environment=MALLOC_CONF=prof_leak:true,lg_prof_sample:0,prof_final:true,prof_prefix:/var/run/dirsrv/jeprof