update to 5.3.0

This commit is contained in:
caodongxia 2023-03-31 17:23:15 +08:00
parent 488e333581
commit 75f19b4264
7 changed files with 28 additions and 136 deletions

View File

@ -1,51 +0,0 @@
From 56c8ecffc1f84f630e10f775bc29fcf4c743a3c9 Mon Sep 17 00:00:00 2001
From: Yinan Zhang <zyn8950@gmail.com>
Date: Thu, 6 Jun 2019 09:22:10 -0700
Subject: [PATCH] Correct tsd layout graph
Augmented the tsd layout graph so that the two recently added fields,
`offset_state` and `bytes_until_sample`, are properly reflected.
As is shown, the cache footprint is 16 bytes larger than before.
---
include/jemalloc/internal/tsd.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h
index 9ba26004..18b2476b 100644
--- a/include/jemalloc/internal/tsd.h
+++ b/include/jemalloc/internal/tsd.h
@@ -20,6 +20,7 @@
* e: tcache_enabled
* m: thread_allocated (config_stats)
* f: thread_deallocated (config_stats)
+ * b: bytes_until_sample (config_prof)
* p: prof_tdata (config_prof)
* c: rtree_ctx (rtree cache accessed on deallocation)
* t: tcache
@@ -27,6 +28,7 @@
* d: arenas_tdata_bypass
* r: reentrancy_level
* x: narenas_tdata
+ * v: offset_state
* i: iarena
* a: arena
* o: arenas_tdata
@@ -35,11 +37,13 @@
* Use a compact layout to reduce cache footprint.
* +--- 64-bit and 64B cacheline; 1B each letter; First byte on the left. ---+
* |---------------------------- 1st cacheline ----------------------------|
- * | sedrxxxx mmmmmmmm ffffffff pppppppp [c * 32 ........ ........ .......] |
+ * | sedrxxxx vvvvvvvv mmmmmmmm ffffffff bbbbbbbb pppppppp [c * 16 .......] |
* |---------------------------- 2nd cacheline ----------------------------|
* | [c * 64 ........ ........ ........ ........ ........ ........ .......] |
* |---------------------------- 3nd cacheline ----------------------------|
- * | [c * 32 ........ ........ .......] iiiiiiii aaaaaaaa oooooooo [t...... |
+ * | [c * 48 ........ ........ ........ ........ .......] iiiiiiii aaaaaaaa |
+ * +---------------------------- 4th cacheline ----------------------------+
+ * | oooooooo [t...... ........ ........ ........ ........ ........ ........ |
* +-------------------------------------------------------------------------+
* Note: the entire tcache is embedded into TSD and spans multiple cachelines.
*
--
2.37.3.windows.1

View File

@ -1,19 +0,0 @@
diff -Nur jemalloc-5.2.1/src/arena.c tmp/src/arena.c
--- jemalloc-5.2.1/src/arena.c 2019-08-06 04:02:00.000000000 +0800
+++ tmp/src/arena.c 2021-11-03 10:23:41.243648055 +0800
@@ -199,13 +199,12 @@
malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
cache_bin_array_descriptor_t *descriptor;
ql_foreach(descriptor, &arena->cache_bin_array_descriptor_ql, link) {
- szind_t i = 0;
- for (; i < SC_NBINS; i++) {
+ for (szind_t i = 0; i < SC_NBINS; i++) {
cache_bin_t *tbin = &descriptor->bins_small[i];
arena_stats_accum_zu(&astats->tcache_bytes,
tbin->ncached * sz_index2size(i));
}
- for (; i < nhbins; i++) {
+ for (szind_t i = 0; i < nhbins - SC_NBINS; i++) {
cache_bin_t *tbin = &descriptor->bins_large[i];
arena_stats_accum_zu(&astats->tcache_bytes,
tbin->ncached * sz_index2size(i));

View File

@ -1,26 +0,0 @@
diff -Nur jemalloc-5.2.1/include/jemalloc/internal/hash.h tmp/include/jemalloc/internal/hash.h
--- jemalloc-5.2.1/include/jemalloc/internal/hash.h 2019-08-06 04:02:00.000000000 +0800
+++ tmp/include/jemalloc/internal/hash.h 2021-11-16 10:49:41.199628212 +0800
@@ -182,19 +182,19 @@
case 13: k4 ^= tail[12] << 0;
k4 *= c4; k4 = hash_rotl_32(k4, 18); k4 *= c1; h4 ^= k4;
JEMALLOC_FALLTHROUGH
- case 12: k3 ^= tail[11] << 24; JEMALLOC_FALLTHROUGH
+ case 12: k3 ^= (uint32_t) tail[11] << 24; JEMALLOC_FALLTHROUGH
case 11: k3 ^= tail[10] << 16; JEMALLOC_FALLTHROUGH
case 10: k3 ^= tail[ 9] << 8; JEMALLOC_FALLTHROUGH
case 9: k3 ^= tail[ 8] << 0;
k3 *= c3; k3 = hash_rotl_32(k3, 17); k3 *= c4; h3 ^= k3;
JEMALLOC_FALLTHROUGH
- case 8: k2 ^= tail[ 7] << 24; JEMALLOC_FALLTHROUGH
+ case 8: k2 ^= (uint32_t) tail[ 7] << 24; JEMALLOC_FALLTHROUGH
case 7: k2 ^= tail[ 6] << 16; JEMALLOC_FALLTHROUGH
case 6: k2 ^= tail[ 5] << 8; JEMALLOC_FALLTHROUGH
case 5: k2 ^= tail[ 4] << 0;
k2 *= c2; k2 = hash_rotl_32(k2, 16); k2 *= c3; h2 ^= k2;
JEMALLOC_FALLTHROUGH
- case 4: k1 ^= tail[ 3] << 24; JEMALLOC_FALLTHROUGH
+ case 4: k1 ^= (uint32_t) tail[ 3] << 24; JEMALLOC_FALLTHROUGH
case 3: k1 ^= tail[ 2] << 16; JEMALLOC_FALLTHROUGH
case 2: k1 ^= tail[ 1] << 8; JEMALLOC_FALLTHROUGH
case 1: k1 ^= tail[ 0] << 0;

View File

@ -1,28 +0,0 @@
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);
}

Binary file not shown.

BIN
jemalloc-5.3.0.tar.bz2 Normal file

Binary file not shown.

View File

@ -11,20 +11,15 @@
%endif %endif
Name: jemalloc Name: jemalloc
Version: 5.2.1 Version: 5.3.0
Release: 2 Release: 1
Summary: General-purpose scalable concurrent malloc implementation Summary: General-purpose scalable concurrent malloc implementation
License: BSD License: BSD-2-Clause
URL: http://www.canonware.com/jemalloc/ URL: http://www.canonware.com/jemalloc/
Source0: https://github.com/jemalloc/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2 Source0: https://github.com/jemalloc/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
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
Patch6000: backport-0001-Correct-tsd-layout-graph.patch BuildRequires: perl-generators gcc /usr/bin/xsltproc
BuildRequires: libxslt perl-generators gcc
%description %description
Implemented by malloc (3), is an independent implementation of jemalloc. Implemented by malloc (3), is an independent implementation of jemalloc.
@ -43,7 +38,7 @@ Summary: help for jemalloc.
The help package contains manual pages and other related files for jemalloc. The help package contains manual pages and other related files for jemalloc.
%prep %prep
%autosetup -p1 %setup -q
%build %build
export LDFLAGS="%{?__global_ldflags} -lrt" export LDFLAGS="%{?__global_ldflags} -lrt"
@ -85,10 +80,31 @@ make check
%{_mandir}/man3/jemalloc.3* %{_mandir}/man3/jemalloc.3*
%changelog %changelog
* Mon Jan 9 2023 mengwenhua <mengwenhua@xfusion.com> - 5.2.1-2 * Tue Mar 07 2023 mawenshuo <mawenshuo1@huawei.com> - 5.3.0-1
- Upgrade to 5.3.0
* Mon Jan 9 2023 mengwenhua <mengwenhua@xfusion.com> - 5.2.1-8
- Correct tsd layout graph - Correct tsd layout graph
* Thu Dec 30 2021 xigaoxinyan <xigaoxinyan@huawei.com> - 5.2.1-1 * Tue Nov 15 2022 doupengda <doupengda@loongson.cn> - 5.2.1-7
- add loongarch64 support
* Tue May 10 2022 Ge Wang <wangge@h-partner.com> - 5.2.1-6
- License compliance rectification
* Thu Dec 2 2021 guominghong <guominghong@huawei.com> - 5.2.1-5
- Fix spec check
* 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
- Fix Undefined Behavior in hash.h
* Wed Nov 3 2021 guominghong <guominghong@huawei.com> - 5.2.1-2
- Fix large bin index accessed through cache bin descriptor
* Tue Jul 20 2021 weidong <weidong@uniontech.com> - 5.2.1-1
- Update jemlloc - Update jemlloc
* Wed Jun 02 2021 wulei <wulei80@huawei.com> - 5.1.0-4 * Wed Jun 02 2021 wulei <wulei80@huawei.com> - 5.1.0-4