Browse Source

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!)
tags/debian/1.4.4.3-1
Viktor Ashirov 8 months ago
parent
commit
8895fc4b4b
2 changed files with 25 additions and 3 deletions
  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 View File

@@ -4,7 +4,7 @@
%global bundle_jemalloc __BUNDLE_JEMALLOC__
%if %{bundle_jemalloc}
%global jemalloc_name jemalloc
%global jemalloc_ver 5.2.0
%global jemalloc_ver 5.2.1
%endif

# 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

%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
pushd ../%{jemalloc_name}-%{jemalloc_ver}
%configure \
--libdir=%{_libdir}/%{pkgname}/lib \
--bindir=%{_libdir}/%{pkgname}/bin
make
--bindir=%{_libdir}/%{pkgname}/bin \
--enable-prof %{lg_page} %{lg_hugepage}
make %{?_smp_mflags}
popd
%endif



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

@@ -51,3 +51,7 @@ TimeoutStopSec=600

# Preload jemalloc
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

Loading…
Cancel
Save