Fix tcaches mutex pre- / post-fork handling

This commit is contained in:
g00523939 2021-11-16 19:17:44 +08:00
parent a21cfe2381
commit a6b7af9d0f
2 changed files with 33 additions and 1 deletions

View File

@ -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);
}

View File

@ -12,7 +12,7 @@
Name: jemalloc Name: jemalloc
Version: 5.2.1 Version: 5.2.1
Release: 3 Release: 4
Summary: General-purpose scalable concurrent malloc implementation Summary: General-purpose scalable concurrent malloc implementation
License: BSD License: BSD
URL: http://www.canonware.com/jemalloc/ 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 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 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 BuildRequires: libxslt perl-generators gcc
%description %description
@ -83,6 +84,9 @@ make check
%{_mandir}/man3/jemalloc.3* %{_mandir}/man3/jemalloc.3*
%changelog %changelog
* Tue Nov 16 2021 guominghong <guominghong@huawei.com> - 5.2.1-4
- Fix tcaches mutex pre-post fork handling
* Tue Nov 16 2021 guominghong <guominghong@huawei.com> - 5.2.1-3 * Tue Nov 16 2021 guominghong <guominghong@huawei.com> - 5.2.1-3
- Fix Undefined Behavior in hash.h - Fix Undefined Behavior in hash.h