]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: add a bcond_with for jemalloc
authorOwen Synge <osynge@suse.com>
Wed, 24 Jun 2015 18:16:54 +0000 (20:16 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:18 +0000 (11:24 +0100)
jemalloc like tcmalloc is a high performance replacement for glibc malloc.
Which is better for ceph can only be told via benchmarks and testing.
This patch makes it easer to test this as an rpm install.

Signed-off-by: Owen Synge <osynge@suse.com>
(cherry picked from commit 7b24b9bfc0a49c9eac6f07eee4d5a52eceddbb34)

Conflicts:
ceph.spec.in
            _udevrulesdir

ceph.spec.in

index bab861a784232c57a0de04d7d9758868341dc2fe..3f013b6cc4556c1a7428b20629cecf277cf76f2f 100644 (file)
@@ -19,6 +19,8 @@
 %bcond_without cephfs_java
 %bcond_with tests
 %bcond_without tcmalloc
+%bcond_with jemalloc
+
 %bcond_without libs_compat
 %bcond_with librocksdb
 
@@ -83,6 +85,9 @@ BuildRequires: systemd
 %if 0%{with cephfs_java}
 BuildRequires: sharutils
 %endif
+%if 0%{with jemalloc}
+BuildRequires: jemalloc-devel
+%endif
 BuildRequires: gcc-c++
 BuildRequires: boost-devel
 BuildRequires: cryptsetup
@@ -518,7 +523,14 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
 %endif
                $MY_CONF_OPT \
                %{?_with_ocf} \
-               %{?_with_tcmalloc} \
+%if 0%{with tcmalloc}
+               --with-tcmalloc \
+               --without-jemalloc \
+%endif
+%if 0%{with jemalloc}
+               --without-tcmalloc \
+               --with-jemalloc \
+%endif
                CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
 
 # fix bug in specific version of libedit-devel