From a7950205fc92f25f06544083b584f71cb6ec0a76 Mon Sep 17 00:00:00 2001 From: Ingvar Hagelund Date: Thu, 12 Jan 2017 16:11:27 +0100 Subject: [PATCH] Disable transparent hugepages on systems not supporting them --- jemalloc-4.4.0.disable_thp.patch | 11 +++++++++++ jemalloc.spec | 29 ++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 jemalloc-4.4.0.disable_thp.patch diff --git a/jemalloc-4.4.0.disable_thp.patch b/jemalloc-4.4.0.disable_thp.patch new file mode 100644 index 0000000..5488a12 --- /dev/null +++ b/jemalloc-4.4.0.disable_thp.patch @@ -0,0 +1,11 @@ +--- configure.orig 2017-01-12 13:18:55.344548013 +0100 ++++ configure 2017-01-12 13:19:05.284128625 +0100 +@@ -8742,7 +8742,7 @@ + } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- je_cv_thp=yes ++ je_cv_thp=no + else + je_cv_thp=no + fi diff --git a/jemalloc.spec b/jemalloc.spec index bbe14b5..e968328 100644 --- a/jemalloc.spec +++ b/jemalloc.spec @@ -1,7 +1,7 @@ Name: jemalloc Version: 4.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: General-purpose scalable concurrent malloc implementation Group: System Environment/Libraries @@ -16,6 +16,9 @@ Patch2: jemalloc-armv5-force-atomic.patch Patch3: jemalloc-3.0.0.atomic_h_ppc_32bit_operations.patch Patch4: jemalloc-3.6.0.no_explicit_altivec.patch +# No Transparent Hugepages on systems not supporting them +Patch5: jemalloc-4.4.0.disable_thp.patch + BuildRequires: /usr/bin/xsltproc BuildRequires: perl-generators %ifnarch s390 %{mips} @@ -46,6 +49,15 @@ developing applications that use %{name}. %endif %endif +# Disable thp on systems not supporting this, trusting that Fedora will enable +# this on the build servers when ready for installed systems. +if test -d /sys/kernel/mm/transparent_hugepage +then +true +else +%patch5 +fi + %build %ifarch i686 %if 0%{?fedora} >= 21 @@ -57,6 +69,18 @@ CFLAGS="%{optflags} -msse2" export LDFLAGS="%{?__global_ldflags} -lrt" %endif +echo "For debugging package builders" +echo "What is the pagesize?" +getconf PAGESIZE + +echo "What mm features are available?" +ls /sys/kernel/mm +ls /sys/kernel/mm/transparent_hugepage || true +cat /sys/kernel/mm/transparent_hugepage/enabled || true + +echo "What kernel version and config is this?" +uname -a + %configure make %{?_smp_mflags} @@ -104,6 +128,9 @@ rm -rf %{buildroot} %postun -p /sbin/ldconfig %changelog +* Thu Jan 12 2017 Ingvar Hagelund - 4.4.0-2 +- Disable transparent hugepages on systems not supporting them + * Fri Dec 09 2016 Ingvar Hagelund - 4.4.0-1 - New upstream release