From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45290 invoked by alias); 27 Oct 2019 18:11:19 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 45277 invoked by uid 89); 27 Oct 2019 18:11:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=glance, piece, mistaken, pose X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx0a-0010f301.pphosted.com Received: from mx0a-0010f301.pphosted.com (HELO mx0a-0010f301.pphosted.com) (148.163.149.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 27 Oct 2019 18:11:17 +0000 Received: from pps.filterd (m0102856.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9RI6Rj9001820; Sun, 27 Oct 2019 13:11:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=date : from : subject : to : cc : message-id : in-reply-to : references : mime-version : content-type; s=ricemail; bh=oooa9JD7A7UMVD66l+9H0y8G++azx3wpQFCyi+FRc5g=; b=BsH/woHaZo0J0L6cvEersBWNzUVTZ8PyPc/jkQu+KQmZTNIIGC7xyo4mwHtjlS4DZq9X s1IlaskNRg1+lcu2+x3mlavPoMkNfXMmI+fn68vEL/sM+/LJp9pLnI+doOkS+TIkx0kn S+RoVe9p49tBcpRrgY98wafrDOYFyoFaAXBD1nAO14uqq8pPbbrsxp6bbgxcf7bBxr6I dzI1uO9rx6D8bxVlOMO9j1xGZ4lVJcflId4zNu+1Tp2x4dpQCRdJcw9sIwUThvkDBVd4 J2wEFZxJw/wmU96/Vw1R3HDKOQjKQ7OORPW29nvjE45hiYsh4jChTe8eBh0uo5pQr2SH PQ== Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mx0b-0010f301.pphosted.com with ESMTP id 2vvk94913a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 27 Oct 2019 13:11:10 -0500 Received-X: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 7951D4038B; Sun, 27 Oct 2019 13:11:09 -0500 (CDT) Received-X: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 7816340339; Sun, 27 Oct 2019 13:11:09 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received-X: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id LdTR7nNZFqoD; Sun, 27 Oct 2019 13:11:09 -0500 (CDT) Received: from c-98-200-170-211.hsd1.tx.comcast.net (c-98-200-170-211.hsd1.tx.comcast.net [98.200.170.211]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jma14) by mh3.mail.rice.edu (Postfix) with ESMTPSA id F1B9D40337; Sun, 27 Oct 2019 13:11:08 -0500 (CDT) Date: Sun, 27 Oct 2019 18:11:00 -0000 From: Jonathon Anderson Subject: Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev() To: Florian Weimer Cc: Mark Wielaard , elfutils-devel@sourceware.org, Srdan Milakovic Message-Id: <1572199867.6114.1@rice.edu> In-Reply-To: <87h83ufts2.fsf@mid.deneb.enyo.de> References: <1565983469.1826.0@smtp.mail.rice.edu> <20190824232438.GA2622@wildebeest.org> <1566695452.979.1@smtp.mail.rice.edu> <5ba06557703ee363e19488c994cbddd92ade25be.camel@klomp.org> <1566782688.5803.0@smtp.mail.rice.edu> <1566826627.5246.0@smtp.mail.rice.edu> <1566877968.10901.0@smtp.mail.rice.edu> <87tv7vg4l0.fsf@mid.deneb.enyo.de> <8fde453a2c570fa150aa39b0dabd0f925c7b0970.camel@klomp.org> <1572108332.6121.0@rice.edu> <87r22ze9ih.fsf@mid.deneb.enyo.de> <2f4616d947caf5e1de3f5eefdf0a89ffa2c00e5e.camel@klomp.org> X-Mailer: geary/3.34.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-27_07:2019-10-25,2019-10-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 mlxlogscore=249 adultscore=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=11 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910270190 Content-Type: text/plain; charset=us-ascii; format=flowed X-SW-Source: 2019-q4/txt/msg00059.txt.bz2 On Sun, Oct 27, 2019 at 09:59, Florian Weimer wrote: > * Mark Wielaard: > >>> Current glibc versions have a thread-local fast path, which should >>> address some of these concerns. It's still not a bump-pointer >>> allocator, but at least there are no atomics on that path. >> >> Since which version of glibc is there a thread-local fast path? > > It was added in: > > commit d5c3fafc4307c9b7a4c7d5cb381fcdbfad340bcc > Author: DJ Delorie > > Date: Thu Jul 6 13:37:30 2017 -0400 > > Add per-thread cache to malloc > > So glibc 2.26. But it is a build-time option, enabled by default, but > it can be switched off by distributions. I doubt any non-mobile distros would disable it, the cost seems fairly small. My main concern is that it seems like chunks will only enter the thread-local cache in the presence of free()s (since they have to enter the "smallbins" or "fastbins" first, and those two at a glance seem to be filled very lazily or on free()); since the free()s are all on dwarf_end this would pose an issue. I could also be entirely mistaken, glibc is by no means a simple piece of code. According to the comments, there might also be a 16 byte overhead per allocation, which would explode the small allocations considerably. -Jonathon