From patchwork Thu Jul 14 00:41:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 13789 Received: (qmail 92152 invoked by alias); 14 Jul 2016 00:41:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 92126 invoked by uid 89); 14 Jul 2016 00:41:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=START, fantastic X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: anton@au1.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org Date: Thu, 14 Jul 2016 10:41:16 +1000 From: Anton Blanchard To: DJ Delorie Cc: carlos@redhat.com, sid@reserved-bit.com, libc-alpha@sourceware.org Subject: Re: Malloc improvements In-Reply-To: References: <20160713185825.5f6a3a83@kryten> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071400-0016-0000-0000-000001B1C42F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071400-0017-0000-0000-00000500C146 Message-Id: <20160714104116.23d8d4eb@kryten> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-13_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607140006 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. */