]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - glibc/patches/glibc-rh740506.patch
openvswitch: Add service file for systemd.
[people/amarx/ipfire-3.x.git] / glibc / patches / glibc-rh740506.patch
CommitLineData
70963a51
MT
1 * malloc/arena.c (arena_get2): Avoid unnecessarily
2 retrieving #cpus from /proc.
3 * malloc/malloc.c (mALLOPt): Clamp arena_test based on
4 the value of arena_max.
5
6diff --git a/malloc/arena.c b/malloc/arena.c
7index cb8548b..00f1da5 100644
8--- a/malloc/arena.c
9+++ b/malloc/arena.c
10@@ -828,7 +828,7 @@ arena_get2(mstate a_tsd, size_t size)
11 {
12 if (mp_.arena_max != 0)
13 narenas_limit = mp_.arena_max;
14- else
15+ else if (narenas > mp_.arena_test)
16 {
17 int n = __get_nprocs ();
18
19diff --git a/malloc/malloc.c b/malloc/malloc.c
20index 8608083..f8d32da 100644
21--- a/malloc/malloc.c
22+++ b/malloc/malloc.c
23@@ -4842,6 +4842,12 @@ int mALLOPt(int param_number, int value)
24 break;
25 #endif
26 }
27+#ifdef PER_THREAD
28+ /* Clamp ARENA_TEST from ARENA_MAX to avoid creating too many
29+ arenas. */
30+ if (mp_.arena_max > 0 && mp_.arena_max <= mp_.arena_test)
31+ mp_.arena_test = mp_.arena_max - 1;
32+#endif
33 (void)mutex_unlock(&av->mutex);
34 return res;
35 }