This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] malloc: tune thread cache
- From: Joern Engel <joern at purestorage dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Joern Engel <joern at purestorage dot com>
- Date: Mon, 25 Jan 2016 16:25:11 -0800
- Subject: [PATCH] malloc: tune thread cache
- Authentication-results: sourceware.org; auth=none
- References: <1453767942-19369-1-git-send-email-joern at purestorage dot com>
Experiments have shown that prefetch of more than one object yields
diminishing returns and can even be harmful. Growing the cache to 128k
yields much better results and should still be small enough.
JIRA: PURE-27597
---
tpc/malloc2.13/tcache.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tpc/malloc2.13/tcache.h b/tpc/malloc2.13/tcache.h
index 0ddee48a30dc..55bf3862af91 100644
--- a/tpc/malloc2.13/tcache.h
+++ b/tpc/malloc2.13/tcache.h
@@ -24,13 +24,13 @@ static inline int fls(int x)
* arena. On free we keep the freed object in hope of reusing it in
* future allocations.
*/
-#define CACHE_SIZE_BITS (16)
+#define CACHE_SIZE_BITS (17)
#define CACHE_SIZE (1 << CACHE_SIZE_BITS)
#define MAX_CACHED_SIZE_BITS (CACHE_SIZE_BITS - 3)
#define MAX_CACHED_SIZE (1 << MAX_CACHED_SIZE_BITS)
#define MAX_PREFETCH_SIZE_BITS (CACHE_SIZE_BITS - 6)
#define MAX_PREFETCH_SIZE (1 << MAX_PREFETCH_SIZE_BITS)
-#define NO_PREFETCH (1 << 3)
+#define NO_PREFETCH (1)
/*
* Binning is done as a subdivided buddy allocator. A buddy allocator
--
2.7.0.rc3