Disable transparent hugepages on systems not supporting them

This commit is contained in:
Ingvar Hagelund 2017-01-12 16:11:27 +01:00
parent 17ce554ada
commit a7950205fc
2 changed files with 39 additions and 1 deletions

View File

@ -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

View File

@ -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 <ingvar@redpill-linpro.com> - 4.4.0-2
- Disable transparent hugepages on systems not supporting them
* Fri Dec 09 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> - 4.4.0-1
- New upstream release