This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Malloc improvements
- From: Anton Blanchard <anton at au1 dot ibm dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: carlos at redhat dot com, sid at reserved-bit dot com, libc-alpha at sourceware dot org
- Date: Thu, 14 Jul 2016 10:41:16 +1000
- Subject: Re: Malloc improvements
- Authentication-results: sourceware.org; auth=none
- References: <20160713185825.5f6a3a83@kryten> <xnoa61y3ws.fsf@greed.delorie.com>
Hi DJ,
> Fixed and pushed. Thanks!
>
> Time for 1B iterations:
>
> 8.51s dj/malloc
> 15.56s glibc
> 9.58s tcmalloc
> 12.09s jemalloc
Fantastic! I verified the fix on POWER8:
baseline 473%
jemalloc 149%
dj/malloc 106%
tcmalloc 100%
I noticed a 32bit sign extension issue when using the updated trace
facility:
71128 ftruncate(3, 2080374784) = 0
...
71128 ftruncate(3, 18446744071562067968) = -1 EINVAL (Invalid argument)
One way of fixing this is below.
Anton
--
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 70e7dc8..3b4781c 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1163,7 +1163,7 @@ __mtb_trace_entry (uint32_t type, size_t size, void *ptr1)
my_num = TRACE_COUNT_TO_MAPPING_NUM (my_trace_count);
if (my_num != __malloc_trace_last_num)
{
- int new_window;
+ long new_window;
int new_ref_count;
/* START W: Switch window. */