From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3340 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cpuset/affinity interfaces and TSX lock elision in musl Date: Sun, 19 May 2013 16:51:20 -0400 Message-ID: <20130519205120.GF20323@brightrain.aerifal.cx> References: <20130516203658.GW20323@brightrain.aerifal.cx> <20130517112802.GA6699@port70.net> <20130517172902.GC20323@brightrain.aerifal.cx> <1368938432.2611.5@driftwood> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1368996695 4163 80.91.229.3 (19 May 2013 20:51:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 May 2013 20:51:35 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3344-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 19 22:51:35 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UeAZq-0003eK-He for gllmg-musl@plane.gmane.org; Sun, 19 May 2013 22:51:34 +0200 Original-Received: (qmail 26039 invoked by uid 550); 19 May 2013 20:51:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26031 invoked from network); 19 May 2013 20:51:33 -0000 Content-Disposition: inline In-Reply-To: <1368938432.2611.5@driftwood> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3340 Archived-At: On Sat, May 18, 2013 at 11:40:32PM -0500, Rob Landley wrote: > On 05/17/2013 12:29:03 PM, Rich Felker wrote: > >> locks should not be the bottleneck in applications > >> unless there is too much shared state on hot paths, > >> which is probably a design bug or a special use-case > >> for which non-standard synchronization methods may > >> be better anyway > > > >One place where there is unfortunately a huge amount of shared state > >is memory management; this is inevitable. Even if we don't use lock > >elision for pthread locks, it might be worth considering using it > >_internally_ in malloc when it's available. It's hard to say without > >any measurements, but this might result in a malloc that beats > >ptmalloc, etc. without any thread-locale management. > > I thought the point of futexes was that in the non-contention case > you don't enter the kernel at all? > > I really don't see how lock elision is supposed to improve upon > that. If you're optimizing the contended case, something is wrong. Yes, that "something" is C++ (and by extension, glib, which might as well be C++ but worse). But we're not in a position to fix it. Rich