From a6b7af9d0fb09ecd68ff8414780a0666ecb8811f Mon Sep 17 00:00:00 2001 From: g00523939 Date: Tue, 16 Nov 2021 19:17:44 +0800 Subject: [PATCH] Fix tcaches mutex pre- / post-fork handling --- ...tcaches-mutex-pre-post-fork-handling.patch | 28 +++++++++++++++++++ jemalloc.spec | 6 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 backport-Jemalloc-5.2.1-patch-3-fix-tcaches-mutex-pre-post-fork-handling.patch diff --git a/backport-Jemalloc-5.2.1-patch-3-fix-tcaches-mutex-pre-post-fork-handling.patch b/backport-Jemalloc-5.2.1-patch-3-fix-tcaches-mutex-pre-post-fork-handling.patch new file mode 100644 index 0000000..fc5a5a7 --- /dev/null +++ b/backport-Jemalloc-5.2.1-patch-3-fix-tcaches-mutex-pre-post-fork-handling.patch @@ -0,0 +1,28 @@ +diff -Nur jemalloc-5.2.1/src/tcache.c tmp/src/tcache.c +--- jemalloc-5.2.1/src/tcache.c 2019-08-06 04:02:00.000000000 +0800 ++++ tmp/src/tcache.c 2021-11-16 19:12:46.889312051 +0800 +@@ -778,21 +778,15 @@ + + void + tcache_prefork(tsdn_t *tsdn) { +- if (!config_prof && opt_tcache) { +- malloc_mutex_prefork(tsdn, &tcaches_mtx); +- } ++ malloc_mutex_prefork(tsdn, &tcaches_mtx); + } + + void + tcache_postfork_parent(tsdn_t *tsdn) { +- if (!config_prof && opt_tcache) { +- malloc_mutex_postfork_parent(tsdn, &tcaches_mtx); +- } ++ malloc_mutex_postfork_parent(tsdn, &tcaches_mtx); + } + + void + tcache_postfork_child(tsdn_t *tsdn) { +- if (!config_prof && opt_tcache) { +- malloc_mutex_postfork_child(tsdn, &tcaches_mtx); +- } ++ malloc_mutex_postfork_child(tsdn, &tcaches_mtx); + } diff --git a/jemalloc.spec b/jemalloc.spec index 6503f2c..acd5217 100644 --- a/jemalloc.spec +++ b/jemalloc.spec @@ -12,7 +12,7 @@ Name: jemalloc Version: 5.2.1 -Release: 3 +Release: 4 Summary: General-purpose scalable concurrent malloc implementation License: BSD URL: http://www.canonware.com/jemalloc/ @@ -20,6 +20,7 @@ Source0: https://github.com/jemalloc/%{name}/releases/download/%{version} Patch1: backport-Jemalloc-5.2.1-patch-1-fix-large-bin-index-accessed-through-cache-bin-descriptor.patch Patch2: backport-Jemalloc-5.2.1-patch-2-fix-undefined-behavior-in-hash.patch +Patch3: backport-Jemalloc-5.2.1-patch-3-fix-tcaches-mutex-pre-post-fork-handling.patch BuildRequires: libxslt perl-generators gcc %description @@ -83,6 +84,9 @@ make check %{_mandir}/man3/jemalloc.3* %changelog +* Tue Nov 16 2021 guominghong - 5.2.1-4 +- Fix tcaches mutex pre-post fork handling + * Tue Nov 16 2021 guominghong - 5.2.1-3 - Fix Undefined Behavior in hash.h -- Gitee